Learn code storage by building a Todo App

‘’’

Tell us what’s happening:

My code doesn’t run, is there something wrong with my answer? or is it a server error?

This is the Question:
To make the id more unique, add another hyphen and use Date.now().

Date.now() returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.

Your code so far

const taskObj = {
id: ${titleInput.value.toLowerCase().split(' ').join('-')}-${Date.now()},
};

‘’’

Learn code storage by building a Todo App

Your browser information:

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

Challenge Info

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-localstorage-by-building-a-todo-app/step-13rmation:

Note I have a backticks there but doesn’t show on the forum text area.

try removing ${} and puting it inside the template literal next to join(’ - ').Date.now()

Still not working.

const taskObj = {
id: ${titleInput.value.toLowerCase().split(' ').join('-').Date.now()},
};

i tried to enter the link of the problem but there is an error. make sure the link to the problem works so i can understand

Here

ok your solution was right . it works for me too i passed the step

id: `${titleInput.value.toLowerCase().split(' ').join('-')}-${Date.now()}`,  
  };
1 Like