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: