fix(curriculum): prevent hardcoding in addition functions (#60196)

This commit is contained in:
Averand1
2025-05-07 20:24:22 +05:30
committed by GitHub
parent 8a6fcd70db
commit baf650a3c7
2 changed files with 12 additions and 0 deletions

View File

@@ -27,6 +27,12 @@ Your `addTwoAndSeven` function should return the sum of `2` and `7`.
assert.strictEqual(addTwoAndSeven(), 9);
```
Your `addTwoAndSeven` function should return the sum using the `+` operator.
```js
assert.match(code, /return\s*(2\s*\+\s*7|7\s*\+\s*2)\s*;?/);
```
# --seed--
## --seed-contents--

View File

@@ -27,6 +27,12 @@ Your `addThreeAndFour` function should return the sum of `3` and `4`.
assert.equal(addThreeAndFour(), 7);
```
Your `addThreeAndFour` function should return the sum using the `+` operator.
```js
assert.match(code, /return\s*(3\s*\+\s*4|4\s*\+\s*3)\s*;?/);
```
You should call the `addThreeAndFour` function inside a `console.log`.
```js