how to check leap year in javascript
function isLeap(year) {
if (year % 4 === 0) {
if (year % 100 === 0){
if (year % 400 == 0){
return ("Leap year.");
} else {
return ("Not leap year.");
}
} else {
return ("Leap year.");
}
} else{
return ("Not leap year.");
}
}function isLeapYear(year) {
if (year % 400 === 0) return true;
if (year % 100 === 0) return false;
return year % 4 === 0;
}
Also in JavaScript:
- closure in javascript
- javascript this inside arrow function
- document write
- how to get value inside span using javascript
- fortuna based rng js
- minvalue validation react admin
- how to floor a number in javascript
- separatly fetch a strings with commas inn js
- choose random from array javascript
- string includes in js
- jquery get img src
- download a file nodejs
- follow and unfollow node js button
- smtpjs cdn
- how to get time and date from iso string javascript
- jquery growl cdn
- import jquery into angular 8
- adding bootstrap to angular global styles
- how to clear state in react hooks
- angular pass async pipe value to funciton
- javascript replace
- javascript write to text file stack overflow
- debugger js
- js remove special characters