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

Tell us what’s happening:

Why isn’t this the solution, would love to know more. Because , couldn’t this be what the question is asking for? very curious…

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

if (userData?.currentSong === null){
  playsong("id === userData?.song[0]")
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

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

Hello @booleanmethod9 !

Good try!

I believe the answer to this question is that we need to target an .id which can be added at the end after the closing ]

As well, there should not be quotation marks.

Make sure the playSong is exactly as it should be, too.

Wishing you good progress on your coding journey. :slightly_smiling_face:

you are calling playsong with the literal string "id === userData?.song[0]"

first, the function is playSong

second, you are asked to pass in the id of one of the songs, not a comparison.

What about userData?.song[0]?
userData doesn’t have a song property, it has a songs property. Fixing that userData?.songs[0] is the first song, not the id of the first song, you would still need to get the id of that.

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