Skip to content

Commit 59a2eac

Browse files
a2937lasjorggikf
authored
fix(curriculum): update calorie counter step 77 to not allow extra addition (freeCodeCamp#55842)
Co-authored-by: Lasse Jørgensen <[email protected]> Co-authored-by: Krzysztof G. <[email protected]>
1 parent f01ff30 commit 59a2eac

File tree

1 file changed

+2
-2
lines changed
  • curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter

1 file changed

+2
-2
lines changed

curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c9e4d2ff41811dd640504f.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ assert.isAbove(calculateCalories.toString().indexOf('consumedCalories'), calcula
2626
You should calculate the sum of `breakfastCalories`, `lunchCalories`, `dinnerCalories`, and `snacksCalories`, in order.
2727

2828
```js
29-
assert.match(calculateCalories.toString(), /breakfastCalories\s*\+\s*lunchCalories\s*\+\s*dinnerCalories\s*\+\s*snacksCalories/);
29+
assert.match(calculateCalories.toString(), /breakfastCalories\s*\+\s*lunchCalories\s*\+\s*dinnerCalories\s*\+\s*snacksCalories\s*;?\s*$/m);
3030
```
3131

3232
You should assign the sum of `breakfastCalories`, `lunchCalories`, `dinnerCalories`, and `snacksCalories` to `consumedCalories`.
3333

3434
```js
35-
assert.match(calculateCalories.toString(), /consumedCalories\s*=\s*breakfastCalories\s*\+\s*lunchCalories\s*\+\s*dinnerCalories\s*\+\s*snacksCalories/);
35+
assert.match(calculateCalories.toString(), /consumedCalories\s*=\s*breakfastCalories\s*\+\s*lunchCalories\s*\+\s*dinnerCalories\s*\+\s*snacksCalories\s*;?\s*$/m);
3636
```
3737

3838
# --seed--

0 commit comments

Comments
 (0)