<<<<<<< HEAD Code Wars - Brett Crafton

Quarter of the year

Question

Given a month as an integer from 1 to 12, return to which quarter of the year it belongs as an integer number.

For example: month 2 (February), is part of the first quarter; month 6 (June), is part of the second quarter; and month 11 (November), is part of the fourth quarter.

Solution by -

My Solution


	const quarterOf = (month) => {
		if(month <= 3)  {
			return 1
		}
		else if(month <= 6){
			return 2
		}
			else if(month <= 9){
			return 3
		}
			else if(month <= 12){
			return 4
		}
	}
				

Try it yourself - CodeWars

======= Code Wars - Brett Crafton

Quarter of the year

Question

Given a month as an integer from 1 to 12, return to which quarter of the year it belongs as an integer number.

For example: month 2 (February), is part of the first quarter; month 6 (June), is part of the second quarter; and month 11 (November), is part of the fourth quarter.

Solution by -

My Solution


	const quarterOf = (month) => {
		if(month <= 3)  {
			return 1
		}
		else if(month <= 6){
			return 2
		}
			else if(month <= 9){
			return 3
		}
			else if(month <= 12){
			return 4
		}
	}
				

Try it yourself - CodeWars

>>>>>>> 0e614172debaa009c8d31330edbeb3b765b59c39