Learn localStorage by Building a Todo App - Step 58

Tell us what’s happening:

The console gives back the error that data is not defined…

Your code so far

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

/* file: styles.css */

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

localStorage.removeItem(data);
console.log(data);

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

Challenge Information:

Learn localStorage by Building a Todo App - Step 58

Because you have using a data without quote marks, the test looking for a "data" string and found data. That’s why it’s says undefined. Also the challenge instructions doesn’t asked for adding a console log