Svelte · Middle · Question 53 of 75
What does <script module> do?
- ✓Correct answer: Its code runs once when the module is first imported, shared by all instances; it can export values
- 2It runs once per component instance
- 3It runs only on the server
Explanation
In Svelte 4 this was <script context="module">. Use it for shared constants, helpers or exported snippets.