Put in order · Svelte and SvelteKit course · Module 2: Components

Order within the Script Section

Arrange the elements of the script section in the recommended order:

Items to put in order

  • Props ($props())
  • Imports
  • Derived values ($derived)
  • Local state ($state)
  • Functions
Show the answer

Correct order:

  1. Imports
  2. Props ($props())
  3. Local state ($state)
  4. Derived values ($derived)
  5. Functions