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

Tell us what’s happening:

i don´t understand why the challenge don´t pass

Instructions

Before deleting a song, you need to check if the song is currently playing. If it is, you need to pause the song and play the next song in the playlist.

Use an if statement to check if the userData?.currentSong?.id is equal to the id of the song you want to delete.

Your code so far

if(userData?.currentSong?.id = id) {}

The challenge tell me a syntax error.

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

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

Bro :sweat_smile:, remember how you could use the equal operator in JavaScript

1 Like

you mean “===”?, because don´t works anyelse, and if i don´t badly remember, this means “strict equal”, not an only equal

Yeah, it is :slightly_smiling_face:, remember it because in JavaScript is different than another program languages

1 Like

You have an assignment operator in your code, not an equality operator (strict or otherwise).

1 Like

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