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

Tell us what’s happening:

i’m not understanding the tips, and i have been trying for days, please i need help on this test.

Your code so far

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

/* file: styles.css */

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

audio.addEventListener("ended", () => {
  const currentSongIndex = getCurrentSongIndex()  
  const nextSongExists = userData.songs.length -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/123.0.0.0 Safari/537.36

Challenge Information:

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

nextSongExists needs to be a boolean (true or false), so you need a comparison. You can compare the length of userData.songs, but you need to compare it with something else.

Example, if the current song is number 6, what could you check to know if there is a next one?

i am not getting it i try using if condition but it not working

you don’t need an if condition

when you use comparison operators (like <, >, === etc…), the expression is evaluated to a boolean value
for example, 5 < 7 is true, while 7 > 9 is false. You need to use one of these operators with two appropriate values.