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

Length of an unknown track

What does formatTime(NaN) return in the player from the lesson, and where does NaN come from?

Answer options

  • "NaN:NaN", because the function divides NaN by 60 like any other number
  • "0:00", because the duration of an audio element is NaN until the browser has loaded the file data
  • "0:00", because NaN means a live stream with no known length
  • A TypeScript error, because NaN is not of type number

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