I really don’t understand why the test is not passing. Can someone help me out?
This is the challenge text:
Step 42
To get the index for the current song, you can use the indexOf() method. The indexOf() array method returns the first index at which a given element can be found in the array, or -1 if the element is not present.
const animals = ["dog", "cat", "horse"];
animals.indexOf("cat") // 1
Inside your getCurrentSongIndex function, return userData?.songs.indexOf(). For the indexOf() argument, set it to userData?.currentSong.
yes, written like this the function expects implicit return, without the return keyword, if you want to use explicit return you need to use {} to surround the function body
You should return userData?.songs.indexOf() inside your getCurrentSongIndex function. You should pass in userData?.currentSong into the indexOf() method.