Learn Basic String and Array Methods by Building a Music Player - Step 92

Tell us what’s happening:

I’ve tried every rearrangement of syntax I can think of. Tried MDN and the forums. Can’t get it to pass.

Your code so far

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

/* file: styles.css */

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

  resetButton.addEventListener("click",resetButton) => {};

// 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/124.0.0.0 Safari/537.36

Challenge Information:

Learn Basic String and Array Methods by Building a Music Player - Step 92

The syntax for adding an event listener with a callback using arrow syntax should be:

item.addEventListener("eventName", () => {
    //code for callback function
});

The funcion addEventListener takes 2 agruments:

  • The event name

  • The callback function

1 Like

It looks like the instructions ask you to leave the callback function empty, but you’ve placed a function there instead. An empty event listener on a click event might look like this:

element.addEventListener(“click”, () => {});

1 Like