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

audio.addEventListener(“ended”, () => {
const currentSongIndex = getCurrentSongIndex();
const nextSongExists = () => {
if (userData.songs.length = currentSongIndex) {
true
} if (userData.songs.length - 1 > currentSongIndex) {
false
}
}
});

I’m not sure if this is what you mean because I am still getting the same error. Please elaborate more on “Additionally you can directly assign the result of the comparison to the nextSongExists variable rather than use an if/else statement.”