mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-19 21:09:51 +08:00
fix(curriculum): clarify leap year in user story (#57700)
This commit is contained in:
parent
2a1713f44b
commit
43175cfd81
@ -15,12 +15,12 @@ Fulfill the user stories below and get all the tests to pass to complete the lab
|
||||
|
||||
1. Define a function called `isLeapYear` that takes a number as an argument.
|
||||
2. Outside the function, declare a variable `year` that stores the value of the year you want to check.
|
||||
3. Inside the function, use an `if/ else` statement or a ternary operator to check if the year is a leap year.
|
||||
4. To check if the year is a leap year, fulfill the following conditions:
|
||||
3. Inside the function, use an `if/ else` statement or a ternary operator to check if the year is a leap year.
|
||||
4. To check if the year is a leap year, fulfill the following conditions:
|
||||
|
||||
- If the year is divisible by `4`, then it is a leap year.
|
||||
- If the year is divisible by `100`, then it is not a leap year.
|
||||
- If the year is divisible by `400`, then it is a leap year.
|
||||
- Unless the year is also divisible by `100`, then it is not a leap year.
|
||||
- Unless the year is also divisible by `400`, then it is a leap year.
|
||||
|
||||
5. If the year is a leap year, return `[year] is a leap year.`. Otherwise, return `[year] is not a leap year.`. You will replace `[year]` with the parameter defined in the `isLeapYear` function.
|
||||
6. You should call the `isLeapYear` function with `year` as the argument and assign the result to a variable named `result`.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user