mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-12 10:00:39 -04:00
fix(curriculum): specify that letters.forEach() call should be nested (#53367)
Co-authored-by: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com> Co-authored-by: Krzysztof G. <60067306+gikf@users.noreply.github.com>
This commit is contained in:
@@ -7,7 +7,7 @@ dashedName: step-16
|
||||
|
||||
# --description--
|
||||
|
||||
In your callback, call `createLabel()` and pass `number` as the argument. You should see some numbers appear in your spreadsheet.
|
||||
In your callback, you will need to make two function calls. Start by calling `createLabel()` and pass `number` as the argument. You should see some numbers appear in your spreadsheet.
|
||||
|
||||
Then call the `.forEach()` method on your `letters` array. Pass an empty callback function which takes a `letter` parameter.
|
||||
|
||||
@@ -46,7 +46,13 @@ assert.match(code, /letters\.forEach\(\s*\(?\s*letter\s*\)?\s*=>\s*\{/)
|
||||
Your callback function should be empty.
|
||||
|
||||
```js
|
||||
assert.match(code, /letters\.forEach\(\s*\(?\s*letter\s*\)?\s*=>\s*\{\s*\}/)
|
||||
assert.match(code, /letters\.forEach\(\s*(\(\s*letter\s*\)|letter)\s*=>\s*\{\s*\}/)
|
||||
```
|
||||
|
||||
Your `letters.forEach()` callback function should be nested inside the `range(1, 99).forEach(number => {}` callback function.
|
||||
|
||||
```js
|
||||
assert.match(code, /range\s*\(\s*1\s*,\s*99\s*\)\s*.forEach\s*\(\s*(\(\s*number\s*\)|number)\s*=>\s*\{\s*[^}]*letters\.forEach\(\s*(\(\s*letter\s*\)|letter)\s*=>\s*\{\s*\}\s*\)\s*\}\s*\)/)
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Reference in New Issue
Block a user