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

Tell us what’s happening: When I submit this code, it says i need to write an else block, which there is…used the same syntax etc as previous code that has passed in this lesson, cant understand why its not passing??

Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

const playPreviousSong = () => {
  if (userData?.currentSong === null) {
    return 0;
  } else {
    const currentSongIndex = getCurrentSongIndex();
  }
  
};

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36

Challenge Information:

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

It is because you are returning 0, you should just return out of the function.


Likely a regex causing the assert message to be less than helpful.

lol, that was driving me mad for hours! Thank you!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.