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

Tell us what’s happening:

My code isn’t working and i don’t know why.
So far i’ve been enjoying this course, but i don’t understand why my solution isn’t working, the tests just do not work.

Your code so far:

  if (userData?.currentSong?.id === id) {
  userData?.currentSong = null;
  userData?.songCurrentTime = 0;
  pauseSong();
  setPlayerDisplay();
  }

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) 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 76

If there is a match then set userData?.currentSong to null and userData?.songCurrentTime to 0.

After that, call the pauseSong() function to stop the playback and the setPlayerDisplay() function to update the player display.

To my understanding, I’m doing the exercise correctly, is there any mistakes that i’m doing? I really need help.

The error i’m getting on the console says:
image

That’s error in instructions, there shouldn’t be optional chaining ?. when assigning.

Would you be interested in creating issue for this problem on github? Sign in to GitHub · GitHub

3 Likes

I’ve been struggling with the same one! even ChatGPT was of no help haha. Any way to “log a bug” with freeCodeCamp to fix the instructions?

1 Like

@lauparabol that can be done on github in the freeCodeCamp repository - Sign in to GitHub · GitHub

I don’t know how, but the test just passed, restarted my browser, cleared cache, deleted all my stuff and it worked!
Perhaps it was a browser thing (?