Question · Vibe coding with Claude Code course · Module 9: Discord clone

Quiz: Sorting data from props

Claude wrote server.categories.sort(...) in ServerSidebar. What is wrong?

Answer options

  • sort orders the array in place, so it changes the data from props
  • Nothing, such a mistake would be reported by npm run lint and npx tsc --noEmit
  • sort does not work on arrays of objects
  • sort returns a new array, so the categories will not be sorted

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