📜  闰年函数javascript代码示例

📅  最后修改于: 2022-03-11 15:03:43.694000             🧑  作者: 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