start adding else-if chapter

pull/2143/head
Richard Harris 7 years ago
parent 0319bc1085
commit 41793b6694

@ -0,0 +1,13 @@
<script>
let x = 7;
</script>
{#if x > 10}
<p>{x} is greater than 10</p>
{:else}
{#if 5 > x}
<p>{x} is less than 5</p>
{:else}
<p>{x} is between 5 and 10</p>
{/if}
{/if}

@ -0,0 +1,11 @@
<script>
let x = 7;
</script>
{#if x > 10}
<p>{x} is greater than 10</p>
{:else if 5 > x}
<p>{x} is less than 5</p>
{:else}
<p>{x} is between 5 and 10</p>
{/if}

@ -0,0 +1,6 @@
---
title: Else-if blocks
---
Just like in JavaScript, we can 'chain' related conditional blocks together:
Loading…
Cancel
Save