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