mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-01 09:03:55 -05:00
fix(curriculum): recursion challenges that abuse global space (#47680)
* fix: recursion challenges that abuse global space #43516 * fix challenge phrasing and create separate test * fix: challenges which pollute/impure functions should not pass * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register.md allow users to ab(use) global space in cash register Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> * Update curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/build-a-roman-numeral-converter-project/roman-numeral-converter.md allow users to abuse global space in roman numeral converter Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> Co-authored-by: kravmaguy <flex4lease@gmail.com> Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
@@ -71,6 +71,13 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
Global variables should not be used to cache the array.
|
||||
|
||||
```js
|
||||
countdown(1)
|
||||
assert.deepStrictEqual(countdown(5), [5, 4, 3, 2, 1]);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
@@ -56,6 +56,13 @@ assert.deepStrictEqual(rangeOfNumbers(6, 9), [6, 7, 8, 9]);
|
||||
assert.deepStrictEqual(rangeOfNumbers(4, 4), [4]);
|
||||
```
|
||||
|
||||
Global variables should not be used to cache the array.
|
||||
|
||||
```js
|
||||
rangeOfNumbers(1, 3)
|
||||
assert.deepStrictEqual(rangeOfNumbers(6, 9), [6, 7, 8, 9]);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
Reference in New Issue
Block a user