Question · Svelte and SvelteKit course · Module 4: Props and Events

Prop Shorthand

How do you use the shorthand syntax when the variable name matches the prop name?

Answer options

  • <Warrior name={name} />
  • <Warrior {name} />
  • <Warrior :name />
  • <Warrior [name] />

You can check the correct answer by solving this task in the CodeWorlds game.