fix(curriculum): small errors in tests and spelling for JS TODO app project (#52438)

This commit is contained in:
Jessica Wilkins
2023-11-27 23:56:52 -08:00
committed by GitHub
parent eca1ec1b4f
commit 14f9dbf965
2 changed files with 3 additions and 3 deletions

View File

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

View File

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