function isLeapYear(year) {
return(year % 4 === 0) && (year % 100 !== 0) || (year % 400 === 0);
}
console.log(`2020년은 윤년입니까? === ${isLeapYear(2020)}`);
console.log(`2010년은 윤년입니까? === ${isLeapYear(2010)}`);
console.log(`2000년은 윤년입니까? === ${isLeapYear(2000)}`);
console.log(`1900년은 윤년입니까? === ${isLeapYear(1900)}`);
true && false || true는
-> (왼쪽부터 이루어져서) false || true
-> true가 됩니다.
2*3/2처럼 같은 등급의 연산자가 여러 개 있으면 왼쪽부터 연산이 이루어집니다
|| 합 (or) true || false; //true
&& 곱 (and) true || false; //false
!== (값과 타입이 다름)
!= (값이 다름)
${}
1.사이에 변수나 연산 등을 삽입할 수 있다.
2.문자열로 자동변환이 된다.