Build a Music Player - Step 17

Tell us what’s happening:

For step 17,I don’t see what is wrong with my code. And help would be appreciated.

Your code so far

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

/* file: styles.css */

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

playButton.addEventListener("click", () => {
  if(userData.currentSong === null){
    playSong(userData.songs.id[0])
  }
});

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Safari/605.1.15

Challenge Information:

Build a Music Player - Step 17

Hi @dreyes61

Inside the if block, call the playSong function with the id of the first song in the userData.songs array.

You need to access the first element of the array.

Happy coding