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

Tell us what’s happening:

Hi there

Does anyone know what the problem is, the error is:

You should assign userData?.songs[currentSongIndex - 1] to a previousSong constant.

Thanks

Your code so far

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

/* file: styles.css */

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

  if (userData?.currentSong === null) return;
  else {
    const currentSongIndex = getCurrentSongIndex();
    const previousSong=getCurrentSongIndex(-1);
    playSong(previousSong.id);
  }

// 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 59

It’s alright, I got it. Thanks