Skip to content

Commit 9904520

Browse files
hbar1stjdwilkin4
andauthored
fix(curriculum): prevent dataArrIndex from being updated in TODO app (freeCodeCamp#57094)
Co-authored-by: Jessica Wilkins <[email protected]>
1 parent 228c231 commit 9904520

File tree

1 file changed

+6
-0
lines changed
  • curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app

1 file changed

+6
-0
lines changed

curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64faf874364ec308f875f636.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ Use the `remove()` method to remove the `parentElement` of the `buttonEl` from t
2727

2828
# --hints--
2929

30+
You should not alter the `dataArrIndex` statement.
31+
32+
```js
33+
assert.match(code, /const\s+deleteTask\s*=\s*\(\s*buttonEl\s*\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\s*(\(\s*item\s*\)|item)\s*=>\s*(item\.id\s*===\s*buttonEl\.parentElement\.id|buttonEl\.parentElement\.id\s*===\s*item\.id)\s*\)\s*;?[\S\s]*\}\s*;?/)
34+
```
35+
3036
You should use the `remove()` method to remove the parent element of `buttonEl`.
3137

3238
```js

0 commit comments

Comments
 (0)