summaryrefslogtreecommitdiff
path: root/Base/home/anon/js/object-expression.js
blob: 143ece5967b28115dd009f76d297eeb7ed4397c4 (plain)
1
2
3
4
5
6
7
8
9
10
const a = 1;
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);