Tell us what’s happening:
Hello there ,
can you help ,please?
I am stuck in this this question
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function getNextSong() {
const currentIndex = getCurrentSongIndex();
if (typeof currentIndex === 'number' && currentIndex < songs.length - 1) {
return songs[currentIndex + 1];
}
}
// 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/140.0.0.0 Safari/537.36
Challenge Information:
Build a Music Player - Step 25
Is songs defined anywhere in the code?
current song is the last one in the playlist.
ILM
4
what about the songs variable?
it is getNextSong()
songs is my playlist array
ILM
6
on what line is it created?
there is not direct line , so I want to add line for this but it does not work ,
const songs = [“Song A”, “Song B”, “Song C”];
ILM
8
what would be the reason to add this line? in what why does it help to solve the task of this step?
if we add this line , we can add function expain
getCurrentSongIndex()
like this
const songs = [“Song A”, “Song B”, “Song C”];
function getCurrentSongIndex() {
return 1;
}
anyway ,what do you want to say ,please
could you explain more ?
ILM
11
would that give you the index from the playlist tho?
you are complicating too much, please try reading again the instructions and reflect on what you are asked to do