fix(curriculum): clarify instructions with implicit return on JS spreadsheet step34 (#54274)

Co-authored-by: Juan Carrillo <juan@juanca.org>
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
Co-authored-by: Lasse Jørgensen <28780271+lasjorg@users.noreply.github.com>
This commit is contained in:
Giovanni Ruberto
2024-05-02 13:50:22 +05:30
committed by GitHub
co-authored by Juan Carrillo Huyen Nguyen Lasse Jørgensen
parent 2495b0ed40
commit 356af61db4
@@ -39,7 +39,13 @@ Your `idToText` function should have an `id` parameter.
assert.match(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\(\s*id\s*\)|id)\s*=>/);
```
You should assign `idToText` the result of calling the `.find()` method on your `cells` array.
Your `idToText` function should return the result of calling the `.find()` method on your `cells` array. Your callback function should use an implicit return.
```js
assert.notMatch(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\(\s*id\s*\)|id)\s*=>\s*cells\.find\(\s*(\(\s*cell\s*\)|cell)\s*=>\s*\{/);
```
Your `idToText` function should use an implicit return.
```js
assert.match(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\(\s*id\s*\)|id)\s*=>\s*cells\.find\(/);
@@ -57,12 +63,6 @@ Your callback function should have a `cell` parameter.
assert.match(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\(\s*id\s*\)|id)\s*=>\s*cells\.find\(\s*(\(\s*cell\s*\)|cell)\s*=>/);
```
Your callback function should use an implicit return.
```js
assert.notMatch(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\(\s*id\s*\)|id)\s*=>\s*cells\.find\(\s*(\(\s*cell\s*\)|cell)\s*=>\s*\{/);
```
Your callback function should return whether `cell.id` is strictly equal to `id`.
```js