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
ILM
2
Please do not add `Preformatted text`
right after the link to the step, it makes the link unusable
ILM
3
you should move the things mentioned without adding parameters to the function
Examples or show me the wrong code
ILM
5
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);
}
};
ILM
7
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