📜  javascript 闰年 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:35.002000             🧑  作者: Mango

代码示例3
function isLeapYear(year) {
    if (year % 4 == 0) {
        console.log("leap year")
    } else {
        console.log("Not a leap year")
    }
}
var myYear = 2020;
isLeapYear(myYear)
// Output:leap year