Learn localStorage by Building a Todo App - Step 45

Tell us what’s happening:

I am at Step 45 of the Todo App Lesson and I am facing an error where in I have to add else block to the if statement.

I have done that but the error remains. I have double checked and the syntax is correct

Your code so far

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

/* file: styles.css */

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

  if (dataArrIndex === -1) {
    taskData.unshift(taskObj);
    addOrUpdateTask()
    
  } else {
      taskData[dataArrIndex] = taskObj
    }

// 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/123.0.0.0 Safari/537.36

Challenge Information:

Learn localStorage by Building a Todo App - Step 45

You are already inside the addOrUpdateTask function, you don’t need to call it.