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

Am doing as they are saying in the instructions but it’s not working i don’t see the problem it’s giving this error: You should add an else block to the existing if block.


if (userData?.currentSong === null || userData?.currentSong.id !== song.id) {
    audio.currentTime = 0;
  }else{
    audio.currentTime = userData.songCurrentTime;
  }

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

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

1 Like

Hello! @sulemankhalil44

We need a single space after else. like… else {

Good luck!

3 Likes

Thanks man i didn’t know this could cause the problem in code editor it doesn’t matter but here

1 Like

yeah it is not an error but the requirement in the challenge.

Anyways, Happy Coding!

The same was discussed here too