Write a function isLeapYear(year) that returns true if the year is a leap year and false if it is not.
year is an integer from 1 to 9999.2024 is a leap year, 2023 is not.1900 is not a leap year, 2000 is.true or false, not the string 'true'.isLeapYear(2024)Returns true
isLeapYear(1900)Returns false
isLeapYear(2000)Returns true
Asked at Infosys · Source
isLeapYear(2024)trueisLeapYear(2023)falseisLeapYear(1900)falseisLeapYear(2000)trueHidden tests run on Submit.