mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): Leap Year Calculator - allow assignment to single declaration (#59539)
This commit is contained in:
+7
-1
@@ -77,10 +77,16 @@ You should call the `isLeapYear` function and pass `year` as a parameter.
|
||||
assert.match(__helpers.removeJSComments(code), /isLeapYear\(\s*year\s*\)/);
|
||||
```
|
||||
|
||||
You should declare a `result` variable.
|
||||
|
||||
```js
|
||||
assert.isDefined(result);
|
||||
```
|
||||
|
||||
You should store the result of calling the `isLeapYear` function in a variable named `result`.
|
||||
|
||||
```js
|
||||
assert.match(__helpers.removeJSComments(code), /(?:var|let|const)\s+result\s*=\s*isLeapYear\(\s*year\s*\)/);
|
||||
assert.match(__helpers.removeJSComments(code), /result\s*=\s*isLeapYear\(\s*year\s*\)/);
|
||||
```
|
||||
|
||||
You should output the `result` to the console using `console.log()`.
|
||||
|
||||
Reference in New Issue
Block a user