0Pricing
Sveltejs Academy · Lesson

Interpolation: {expression}

Embed JavaScript expressions directly into Svelte HTML templates.

Curly Brace Syntax

Embed any JavaScript expression in markup by wrapping it in curly braces.

<p>Hello {name}!</p>

Math and Strings

Expressions can be more than variable names. Do math, string concatenation, or method calls.

<p>{count + 1} items, formatted: {name.toUpperCase()}</p>

All lessons in this course

  1. The script template style Structure
  2. Reactive Variables with let
  3. Interpolation: {expression}
  4. Computed Values: $: reactive declarations
← Back to Sveltejs Academy