Svelte · Junior · Question 7 of 76
What is the shorthand for <img src={src} alt={alt} />?
- ✓Correct answer:
<img {src} {alt} /> - 2
<img :src :alt /> - 3
<img src alt />
Explanation
When an attribute and a variable share a name, {name} is enough. You can also spread an object: <img {...attrs} />.