Question · Vibe coding with Claude Code course · Module 11: Spotify clone

The Play button only asks

What does togglePlay() do in the player from the lesson?

Answer options

  • It flips isPlaying to the opposite value and then calls play() or pause()
  • It sets isPlaying to true and waits for the track to end
  • It changes the loop attribute so the track plays in a circle
  • It calls play() or pause() on the audio element, and the button label changes only after the play or pause event

You can check the correct answer by solving this task in the CodeWorlds game.