Professional Documents
Culture Documents
5. reactive values -
$: fullName = `${firstName} ${lastName}`;
6. reactive statement - both reactive values and reactive statements change when
there is an event or value change.
$: console.log(beltColour);
$:{
console.log(beltColour);
console.log(fullName);
}
7. loop
{/each}
using else:
8.
{#if num > 20}
<p>Greater than 20</p>
{#else if num >100}
<p>Greater than 100</p>
{#else}
<p>Greater than 1000</p>
{/if}
9. css conditional
if isPromo is true then div will have backdrop and promo classes both.
i.e. class = backdrop promo
10.