If statement - step 91

Question:
Use an if statement to check if nextSongExists exists, then call the playNextSong() function in the if block. This will automatically play the next song when the current song ends.

Code:
if (nextSongExists) {
playNextSong();
}
The help button doesn’t even show up. I just can’t submit.

you may have a syntax error… does the Console show something?

No it doesn’t. What kind of syntax error?

Wait I lied. Here is the console:

SyntaxError: unknown: Unexpected token (243:29)

241 |
242 | renderSongs(sortSongs());

243 | setPlayButtonAccessibleText()
| ^
SyntaxError: unknown: Unexpected token (243:30)

241 |
242 | renderSongs(sortSongs());

243 | setPlayButtonAccessibleText();
| ^
SyntaxError: unknown: Unexpected token (243:29)

241 |
242 | renderSongs(sortSongs());

243 | setPlayButtonAccessibleText()
|

an error at the end of the code usually indicates that you have a missing closing parenthesis somewhere

You most likely deleted the closing }); part of addEventListener and its callback by accident. I would reset the code and try again.

Would resetting the code bring me back to the first step?

No, it just resets the code of this step.

Oh good, I was about to say…

Thank you!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.