# 문제 상황
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.
# 답안
const quarterOf = (month) => {
// Your code here
if(month <= 3) return 1
else if(month <=6 ) return 2;
else if(month <= 9) return 3;
else return 4;
}
# 실행 결과
'STUDY > JavaScript' 카테고리의 다른 글
JavaScript | programmers 옹알이 (0) | 2022.10.04 |
---|---|
JavaScript | [CodeWars] Coefficients of the Quadratic Equation (0) | 2022.01.11 |
JavaScript | [CodeWars] Credit Card Mask (0) | 2022.01.11 |
JavaScript | 정규표현식 기초 / 사용법 (0) | 2022.01.11 |
JavaScript | [프로그래머스] 완주하지 못한 선수 (0) | 2022.01.10 |