Tell us what’s happening:
const nextSongExists = userData.songs.length - 1 > currentSongIndex ? true : false;
I’m trying to find what the problem might be. From what I understand about the challenge question is that we need to assign the boolean values true or false depending on the whether the following check passes the test or not.
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
audio.addEventListener("ended", () => {
const currentSongIndex = getCurrentSongIndex();
const nextSongExists = userData.songs.length - 1 > currentSongIndex ? true : false;
})
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Challenge Information:
Learn Basic String and Array Methods by Building a Music Player - Step 96