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:
- Imports
- Props ($props())
- Local state ($state)
- Derived values ($derived)
- Functions