Code a JavaScript function called isLeapYear() that accepts one integer value as its parameter and will return true if this value is a leap year and false if it is not. Rules: A leap year is divisible by four but not divisible by 100 unless it is divisible by 400. E.g. 1600, 1912, 1996, 2000, 2020 and 2124 are leap years where 1000 and 3000 are not.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 9RQ
icon
Related questions
Question

Code a JavaScript function called isLeapYear() that accepts one integer value as its parameter and will return true if this value is a leap year and false if it is not. Rules: A leap year is divisible by four but not divisible by 100 unless it is divisible by 400. E.g. 1600, 1912, 1996, 2000, 2020 and 2124 are leap years where 1000 and 3000 are not.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning