Svelte · Junior · Question 7 of 76

What is the shorthand for <img src={src} alt={alt} />?

Explanation

When an attribute and a variable share a name, {name} is enough. You can also spread an object: <img {...attrs} />.

Further reading

Problem with a question

Svelte · Junior · question 7

Test yourself

Take the Svelte · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz