mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-25 02:14:11 -05:00
fix(curriculum): small errors in tests and spelling for JS TODO app project (#52438)
This commit is contained in:
@@ -9,7 +9,7 @@ dashedName: step-34
|
||||
|
||||
There's a problem. If you add a task, and then add another, the previous task gets duplicated. This means you need to clear out the existing contents of `tasksContainer` before adding a new task.
|
||||
|
||||
Set the `innerHTML` of `taskContainer` back to an empty string.
|
||||
Set the `innerHTML` of `tasksContainer` back to an empty string.
|
||||
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -28,13 +28,13 @@ assert.match(code, /const\s*editTask\s*=\s*\(buttonEl\)\s*=>\s*\{\s*const dataAr
|
||||
You should pass in `item` as the parameter of the `findIndex()` arrow function callback. Don't use curly braces.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s*editTask\s+=\s*\(buttonEl\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\(item\)/)
|
||||
assert.match(code, /const\s*editTask\s+=\s*\(buttonEl\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\s*\(?item\)?/)
|
||||
```
|
||||
|
||||
Your arrow function callback should check if `item.id === buttonEl.parentElement.id`.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s*editTask\s+=\s*\(buttonEl\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\(item\)\s*=>\s*item\.id\s*===\s*buttonEl\.parentElement\.id\);?\s*\};?/)
|
||||
assert.match(code, /const\s*editTask\s+=\s*\(buttonEl\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\s*\(?item\)?\s*=>\s*item\.id\s*===\s*buttonEl\.parentElement\.id\);?\s*\};?/)
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Reference in New Issue
Block a user