Recall & Review
beginner
How do you declare a variable to hold data in a Svelte page?
You declare a variable inside a <script> tag using
let or const. This variable can then be used in the page's HTML.Click to reveal answer
beginner
What is the syntax to display a variable's value in a Svelte page?
Use curly braces
{variableName} inside the HTML to show the variable's current value.Click to reveal answer
beginner
How can you update data reactively in a Svelte page?
When you change a variable declared with
let, Svelte automatically updates the page where that variable is used.Click to reveal answer
beginner
What is the role of the
<script> tag in a Svelte page?The
<script> tag holds JavaScript code, including data variables and functions, which control the page's behavior and data.Click to reveal answer
intermediate
How do you pass data from a Svelte page to a child component?
You pass data as props by adding attributes to the child component tag, like
<Child data={value} />.Click to reveal answer
Where do you declare variables to use data in a Svelte page?
✗ Incorrect
Variables must be declared inside the