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

Tell us what’s happening:

Hello, I’m stumped on this one and could use some help. I got my code below can’t figure out why it won’t pass. Thank you, Ben

Inside your getCurrentSongIndex function, return userData?.songs.indexOf() . For the indexOf() argument, set it to userData?.currentSong .

Your code so far

const getCurrentSongIndex = () => {
  userData?.songs.indexOf(userData?.currentSong);
}

Your browser information:

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

return userData?.songs.indexOf() . For the indexOf() argument, set it to userData?.currentSong .

Are you returning it?

That worked, thank you for the help!

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