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

i can’t understand this error
SyntaxError: unknown: Support for the experimental syntax ‘optionalChainingAssign’ isn’t currently enabled (93:5): 91 | audio.title = song.title; 92 | > 93 | if (userData?.currentSong = null || userData?.currentSong.id !== song.id) { | ^ 94 | audio.currentTime = 0"; 95 | } 96 | };

if (userData?.currentSong = null || userData?.currentSong.id !== song.id) {
  audio.currentTime = 0;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 OPR/105.0.0.0 (Edition std-2)

Challenge Information:

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

Hi there. The reason for this code not working properly is because the code is trying to assign a value to something that may not even exist. For comparison operations you need to use either double or triple equals. Triple equals means strict comparison and is typically preferred more in Javascript.

More on Strict comparison.

2 Likes

thank you, your replie is really helpful

1 Like