Object Initialization With Shorthand Property Names
const one = 1,
two = 2,
three = 3;const obj1 = {
one: one,
two: two,
three: three
};
// Object { one: 1, two: 2, three: 3 }const obj2 = {
one,
two,
three
};
// Object { one: 1, two: 2, three: 3 }Last updated