Learn localStorage by Building a Todo App - Step 8

Tell us what’s happening:

I don’t know what’s wrong with my code.

Your code so far

cancelBtn.addEventListener(‘click’, ()=>{


The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

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

Challenge Information:

Learn localStorage by Building a Todo App - Step 8

Hey @edwin1,

i can not explain why, but the curly braces are responsible for the code not working.

cancelBtn.addEventListener(‘click’, () => confirmCloseDialog.close())

This should work. Maybe it is because we call a function anyways? So we dont have to declare a new one with those curly braces?

Hope I could help!

1 Like

It worked. Thank you so much.

Curly braces are only needed when there are multiple expressions to return to the right of the arrow.

1 Like