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

Library: identifiers instead of copies

Why does Library hold followedArtistIds and not copies of artist objects?

Answer options

  • Objects cannot be elements of an array in TypeScript
  • Identifiers sort faster than objects
  • An identifier never goes stale, while a copy would keep the old name after the artist changes it
  • Library is saved in the page address, and only strings fit there

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