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

Tell us what’s happening:

I’m stuck on this step. Here is my code that keeps failing:

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

It’s telling me I should add in pauseSong as the second argument of addEventListener. I’ve tried putting pauseSong() in the bracket portion of the code, but that doesn’t work either. Pretty stuck on this one, any help would be much appreciated!

Your code so far

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

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

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

// User Editable Region
/* file: styles.css */

Your browser information:

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

Challenge Information:

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

The second parameter of the listener is a reference to a function so just write the name of the function without parentheses.

1 Like

Hi there and welcome to our community!

You’re not defining a callback function here, only referring to an extant function, so you only need the function name as the second argument. You don’t even need to follow the function name with parentheses, as you would if you were directly calling the function.

1 Like