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:
abe
2022-10-12 13:00:24 -07:00
committed by GitHub
parent 1459bc6879
commit 4ab1dd8926
3 changed files with 21 additions and 0 deletions

View File

@@ -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--

View File

@@ -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--