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

Tell us what’s happening:

I am not sure if I have done the right thing, equating (assign) the variable to the function in the else block as maybe required?

Your code so far

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

/* file: styles.css */

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

  if (userData?.currentSong === null) {
    playSong(userData?.songs[0].id);
  } else {
     currentSongIndex = getCurrentSongIndex();
  }

// 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/126.0.0.0 Safari/537.36 Edg/126.0.0.0

Challenge Information:

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

This should have been declared as a constant.

1 Like

Thank you, that escaped me.

1 Like