Leap year determination in JavaScript

Using the tricks we've learned so far, we can easily determine if any year is a leap year or not: we just need to know how many days are in February. For this we need to take the zero day of March:

javascriptlet date = new Date(2020, 2, 0);
console.log(date.getDate()); // shows 29, because 2020 is a leap year

Let's improve our code so that the year type is displayed as text:

javascriptlet date = new Date(2020, 2, 0);

if (date.getDate() == 29) {
  console.log('a leap year');
} else {
  console.log('not a leap year');
}
Задание 1

Make the function isLeap that takes a year as a parameter and returns true if it's a leap year, and false otherwise.