Tell us what’s happening:
I dont know the syntax for this Step.
Does i need a console.log? or does it need to include it in the line before.
( Step 18
To make the id
more unique, add another hyphen and use Date.now().)
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
id: `${titleInput.value.toLowerCase().split(' ').join('-')}}`,
console.log($Date.now())
// User Editable Region
};
Your browser information:
User Agent ist: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Challenge Information:
Learn localStorage by Building a Todo App - Step 18
`id: `${titleInput.value.toLowerCase(`${Date.now()}`).split(' ').join('-')}}`, `
Maybe this code is close?
the hint says:
You should add -${Date.now()}
to ${titleInput.value.toLowerCase().split(' ').join('-')}
. Don’t forget it needs to be inside the template string.
So try adding that to the end of the string.
I already added it to every position that is possible…
${Date.now()} ------ Did I forgot the “-” at the front?
Can you repost that line of your code to show the changes you made. Please put three backticks before and after the code when posting it on the forum.
It looks like the step already has a console log for taskObj at line 39. See if it removing the console log from your code helps as that appears to be unnecessary.
const taskObj = {
id: `${titleInput.value.toLowerCase(``).split(' ').join('-')}` + `${Date.now()}`,
console.log(taskObj);
});
Got it!
Had to remove the + and the `` .
1 Like