Learn localStorage by Building a Todo App - Step 6

Tell us what’s happening:

// running tests
Your event listener’s callback function should use the classList.toggle() method to toggle the hidden class on the taskForm element. Refer back to the example provided in the description.
// tests completed

I have followed the question to my best ability and am still erroring out. I don’t find this step to be over my head just trying to figure out what I did wrong.

openTaskFormBtn.addEventListener("click", () => {
  taskForm.classList.toggle("hidden");
});

Your code so far

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

/* file: styles.css */

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

openTaskFormBtn.addEventListener("click", () => {
  taskForm.classList.toggle("hidden");
});

// 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/121.0.0.0 Safari/537.36 OPR/107.0.0.0

Challenge Information:

Learn localStorage by Building a Todo App - Step 6

It seems that this lesson will only accept the “implicit return” syntax, even though if it said to do that, I missed it

In an expression body, only a single expression is specified, which becomes the implicit return value. In a block body, you must use an explicit return statement.

Example, (you want it to look like the first one):

const func = (x) => x * x;
// expression body syntax, implied "return"

const func2 = (x, y) => {
  return x + y;
};
// with block body, explicit "return" needed

Add an event listener to the openTaskFormBtn element and pass in a click event for the first argument and an empty callback function for the second argument.

For the callback function, use the classList.toggle() method to toggle the hidden class on the taskForm element.

The step specifically asks for you to put in 2 arguments. When I try to make it look like the first example the console gets angry and says EventListener requires 2 arguments when one is present.

I meant in regards to your callback function. Get rid of the brackets and put it all on one line.