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

Tell us what’s happening: I keep receiving a “Your 'getCurrentSongIndex` function should use arrow syntax” error.

I’ve tried to solve it a couple of ways. Nothing has worked so far. But, it seems to me that one of them should have. I’ve tried the “Read-Search-Ask” method. I looked for help on Google/YouTube. Not sure what I’m doing wrong.

Your code so far

Code Version One:

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

Code Version Two:

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0

Challenge Information:

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

It looks like you are jumping ahead a little bit.

The directions want you to create the function.
You don’t need to worry about the indexof stuff until the next steps.

once you fix that, then it will pass

2 Likes

Thank you so much! I don’t know why I overthought that so much.

1 Like

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