fix(curriculum): Leap Year Calculator - allow assignment to single declaration (#59539)

This commit is contained in:
Lasse Jørgensen
2025-04-03 20:47:34 +02:00
committed by GitHub
parent 175c46c43e
commit f584260acb
@@ -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()`.