Svelte · Junior · Question 17 of 76
How do you render content conditionally?
{#if user}
<p>Hi, {user.name}</p>
{:else}
<a href="/login">Sign in</a>
{/if}- ✓Correct answer: With
{#if},{:else if},{:else}and{/if}blocks - 2With a
v-ifattribute - 3With
<If condition={...}>component
Explanation
Blocks start with #, continue with : and end with /.