Learn localStorage by Building a Todo App - Step 17

Hi everyone,

I’m trying to make an ID unique by following these instructions:

Embed the value inside ${}.
Add a unique number to the ID.
My current code looks like this:

javascript
id: ${titleInput.value.toLowerCase().split(" ").join("-")}

I’ve tried the Read-Search-Ask approach, but I’m still stuck. Can anyone help me figure out how to correctly add a unique number to make the ID truly unique?

Your code so far

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

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

    id : `${titleInput.value.toLowerCase().split(" ").join("-")}`

// User Editable Region
/* file: styles.css */

Your browser information:

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

Challenge Information:

Learn localStorage by Building a Todo App - Step 17

I think they show this in the next lesson. Just follow the step’s instructions for now.

1 Like

Hello,
your template literal looks correct - it’s the space between the property name and the colon that’s a problem

1 Like

Wow, thank you so much! That really cleared things up.

1 Like