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

Tell us what’s happening:

i dont understand the instructions i was told to assign a nextSongExists constant to a boolean value true or false and i have done that but my was not passed

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

audio.addEventListener("ended", () => {
  const currentSongIndex = getCurrentSongIndex() 
  const nextSongExists = true
});

// 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/126.0.0.0 Safari/537.36

Challenge Information:

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

The instructions were:

create a nextSongExists constant that contains the boolean value true or false depending on if the next song exists.

But in your code you just say that nextSongExists is always true?

i assigned the nextSongExists to true || false

What is the result of true || false?

It is always true.

What else did the step say you need to consider to decide if there is a next song or not?

i tried comparing the currentsong index and the userdata length and my code was passed

1 Like