summaryrefslogtreecommitdiff
path: root/Base/home/anon/js
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-20 20:51:59 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-20 21:56:40 +0100
commit8f7d4f67a4907297d60e0e2a5cc3cfdddfc69814 (patch)
treeec449493a624f99c527a9dc86bb93f2e47820014 /Base/home/anon/js
parenta3d2e074466598598ce1b3b8dadbb7c22c54b0a8 (diff)
downloadserenity-8f7d4f67a4907297d60e0e2a5cc3cfdddfc69814.zip
LibJS: Support reading/writing elements in an Array via Object get/put
I'm not completely thrilled about Object::get() and Object::put() doing special-case stuff for arrays, and we should probably come up with a better abstraction for it. But at least it works for now, which is really nice. :^)
Diffstat (limited to 'Base/home/anon/js')
-rw-r--r--Base/home/anon/js/array.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/Base/home/anon/js/array.js b/Base/home/anon/js/array.js
index 41e3b559a3..2a643b96f3 100644
--- a/Base/home/anon/js/array.js
+++ b/Base/home/anon/js/array.js
@@ -1,8 +1,7 @@
var a = [1, 2, 3];
-console.log(a);
-/*
+a[1] = 5;
+
for (var i = 0; i < 3; ++i) {
console.log(a[i]);
}
-*/