Skip to content

Commit

Permalink
fix(curriculum): prevent dataArrIndex from being updated in TODO app (f…
Browse files Browse the repository at this point in the history
…reeCodeCamp#57094)

Co-authored-by: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com>
  • Loading branch information
hbar1st and jdwilkin4 authored Nov 8, 2024
1 parent 228c231 commit 9904520
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ Use the `remove()` method to remove the `parentElement` of the `buttonEl` from t

# --hints--

You should not alter the `dataArrIndex` statement.

```js
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*;?/)
```

You should use the `remove()` method to remove the parent element of `buttonEl`.

```js
Expand Down

0 comments on commit 9904520

Please sign in to comment.