Added value to code example

So that it is more consistent with the tutorial text.
pull/2491/head^2
Pier Bover 7 years ago committed by GitHub
parent 0813b4645b
commit 67bd3a56fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,8 +1,8 @@
<script>
let numbers = [1, 2, 3, 4];
function addNumber() {
numbers.push(numbers.length + 1);
function addNumber(value) {
numbers.push(value);
}
$: sum = numbers.reduce((t, n) => t + n, 0);
@ -12,4 +12,4 @@
<button on:click={addNumber}>
Add a number
</button>
</button>

Loading…
Cancel
Save