Learn localStorage by Building a Todo App - Step 36

Tell us what’s happening:

Everything looks ok to me here spot the syntax on my code thanks.

Your code so far

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

/* file: styles.css */

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

const addOrUpdateTask = (dataArrIndex, taskObj, taskData) => {
if (dataArrIndex !== undefined && dataArrIndex !== null && dataArrIndex !== 0) {
    taskData[dataArrIndex] = taskObj;
} else {
  taskData.push(taskObj);
  }
};

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Safari/605.1.15

Challenge Information:

Learn localStorage by Building a Todo App - Step 36

Please do not add `Preformatted text` right after the link to the step, it makes the link unusable

you should move the things mentioned without adding parameters to the function

Examples or show me the wrong code

there is no request to add parameters to the function, so this part of your code is wrong

Here’s my updated code

const addOrUpdateTask = () => {
if (dataArrIndex !== undefined && dataArrIndex !== null && dataArrIndex !== 0) {
taskData[dataArrIndex] = taskObj;
} else {
taskData.push(taskObj);
}
};

now you are missing the definition of the dataArrIndex variable. If you deleted it already you may want to reset the step to get the code back