Skip to content

Commit 865c28f

Browse files
authored
Update tutorial (sveltejs#371)
Updated the example in the tutorial to match the answer in the exercise.
1 parent 9882419 commit 865c28f

File tree

1 file changed

+3
-3
lines changed
  • content/tutorial/01-svelte/04-logic/04-each-blocks

1 file changed

+3
-3
lines changed

content/tutorial/01-svelte/04-logic/04-each-blocks/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Instead of laboriously copying, pasting and editing, we can get rid of all but t
1111
<div>
1212
+++{#each colors as color}+++
1313
<button
14-
aria-current="{selected === 'red' ? 'true' : undefined}"
14+
aria-current={selected === 'red'}
1515
aria-label="red"
1616
style="background: red"
1717
on:click={() => selected = 'red'}
@@ -29,7 +29,7 @@ Now we need to use the `color` variable in place of `"red"`:
2929
<div>
3030
{#each colors as color}
3131
<button
32-
aria-current="{selected === +++color+++ ? 'true' : undefined}"
32+
aria-current={selected === +++color+++}
3333
aria-label=+++{color}+++
3434
style="background: +++{color}+++"
3535
on:click={() => selected = +++color+++}
@@ -45,7 +45,7 @@ You can get the current _index_ as a second argument, like so:
4545
<div>
4646
{#each colors as color, +++i}+++
4747
<button
48-
aria-current="{selected === color ? 'true' : undefined}"
48+
aria-current={selected === color}
4949
aria-label={color}
5050
style="background: {color}"
5151
on:click={() => selected = color}

0 commit comments

Comments
 (0)