Languages
[Edit]
EN

JavaScript - check if specific year is leap

0 points
Created by:
sienko
743

In this article, we would like to show you how to check if the specific year is leap in JavaScript.

Quick solution:

 

Practical example

Edit

In this example, we check if the specific year is leap with the following conditions:

  • check if the year is a multiple of 400,
  • or if it's a multiple of 4 and not multiple of 100.

Then we return the appropriate value true or false depending on the result.

Runnable example:

Output:

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join