diff options
Diffstat (limited to 'Base/home/anon/js/object-expression.js')
-rw-r--r-- | Base/home/anon/js/object-expression.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Base/home/anon/js/object-expression.js b/Base/home/anon/js/object-expression.js index 58449a2c0a..143ece5967 100644 --- a/Base/home/anon/js/object-expression.js +++ b/Base/home/anon/js/object-expression.js @@ -1,7 +1,10 @@ const a = 1; -const object = {a, b: 2}; +const computedKey = "d"; +const object = {a, b: 2, "c": 3, [computedKey]: 2 + 2}; const emptyObject = {}; console.log(object.a); console.log(object.b); +console.log(object.c); +console.log(object.d); console.log(emptyObject.foo); |