댓글 검색 목록

[javascript] 연도가 윤년인지 확인

페이지 정보

작성자 운영자 작성일 20-05-10 17:34 조회 592 댓글 0
const isLeapYear = year => (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));

// Or
// Get the number of days in February
const isLeapYear = year => new Date(year, 1, 29).getDate() === 29;

댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.