Essential JavaScript

Leap Year Kata

You are working for the newly founded Spacetime Consortium. Being a new organization, they don't have many tools to use yet, and they want to build from the ground up.

Your job, in order to help maintain the equilibrium of the fabric of this universe, is to write a function that determines if a particular Earth year is a leap year.

Given an integer representing the current year, return true if the year is a leap year and false if it is not.

The rule for a leap year is simple: any year that is evenly divisible by 4 but not by 100 is a leap year.

Code Editor