Build a Todo App using Local Storage - Step 11

Tell us what’s happening:

iam stuck on step 11 .

and here is the console message:
3. Your arrow function callback should check if

item.id === currentTask.id

.

i don’t know how to get it and i searched for the problem i found someone stuck on the same and
ILM replied him but i still don’t get it

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

const dataArrIndex = taskData.findIndex((item) => {
  if(item.id === currentTask.id) {}
})

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36

Challenge Information:

Build a Todo App using Local Storage - Step 11

The findIndex method is searching the array. The callback returns the index of the item which meets the condition. There’s no need for an if statement. Remember how to do implicit returns as well.

1 Like

to be honest, i tricked this step when i jumped to the step after it and i got the code, is this a tricky thing ? in the past i think i wasn’t able to go to next step till i pass the current step, but i learnt a good lesson by the way
what you see ?!

1 Like