0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 01:11:24 +01:00

Add implementation for the given tutorial example

This commit is contained in:
Karsten 7 2019-05-27 13:49:20 +02:00 committed by GitHub
parent b0b86f7e26
commit 6d59a40a62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,3 +24,9 @@ function addNumber() {
You can use similar patterns to replace `pop`, `shift`, `unshift` and `splice`.
> Assignments to *properties* of arrays and objects — e.g. `obj.foo += 1` or `array[i] = x` — work the same way as assignments to the values themselves.
>
> ```js
> function addNumber() {
> numbers[numbers.length] = numbers.length + 1;
> }
> ```