mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 03:15:06 +00:00
LibJS: Implement computed properties in object expressions
This commit is contained in:
parent
bebd5c097c
commit
746dd5b190
5 changed files with 98 additions and 19 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue