Curly Braces & Understanding Core Syntax
Curly Braces & Understanding Core Syntax in Svelte
Basic Usage of Curly Braces
Functions and Variables
<script>
let name = "Shento";
let age = $state(23);
function increaseAge() {
age += 1;
}
</script>
<h1>Hello, my name is {name}, my age is {age}</h1>
<button onclick={increaseAge}>Increase my age</button>Explanation
Single-Line Expressions
Explanation
Additional Information
Warning
Critical Alert
Last updated