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

Tell us what’s happening:

Hi there

What am I missing, it should be something straightforward

Thanks
Iskren

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 {
    const currentSongIndex;
    currentSongIndex = getCurrentSongIndex();
  }


// 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/17.4.1 Safari/605.1.15

Challenge Information:

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

Hi there!

If you declare a variable with const keyword and leave it without assign a value to it. It’s throwing an error.

You need a one linear declaration and assignment.

1 Like