Step 25
Add an else
block to handle the current song’s position in the playlist.
Within the else
block, set the currentTime
property of the audio
object to the value stored in userData.songCurrentTime
.
The code so far
if (userData?.currentSong === null || userData?.currentSong.id !== song.id) {
audio.currentTime = 0;
}
Below is my answer, but it keeps return
Sorry, your code does not pass. Don’t give up.
You should add anelse
block to the existingif
block.
if (userData?.currentSong === null || userData?.currentSong.id !== song.id) {
audio.currentTime = 0;
} else{
audio.currentTime = userData.currentSongTime;
}
Please help