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

Tell us what’s happening:

keep getting the error You should call the "playSong" function with "userData?.songs[0].id" inside the "if" statement
edit: found the problem
the code inside the if statement should read
playSong(userData?.songs[0].id);

Your code so far

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

/* file: styles.css */

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

const playNextSong = () => {
  if (userData?.currentSong === null) {
    userData?.songs[0].id.playSong();
  }
}

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

Challenge Information:

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

if you look up at line 88 you will see that playSong is expecting an id
so do you think the way you are calling it is correct?

1 Like