From 6d59a40a626edb859f454af2ce3e149af9c66d68 Mon Sep 17 00:00:00 2001 From: Karsten 7 Date: Mon, 27 May 2019 13:49:20 +0200 Subject: [PATCH] Add implementation for the given tutorial example --- .../02-reactivity/04-updating-arrays-and-objects/text.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md b/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md index 0a78c7ca32..9cc875bc73 100644 --- a/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md +++ b/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md @@ -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; +> } +> ```