viphat / til

Today I Learned
http://notes.viphat.work
0 stars 1 forks source link

ES6 (ES2015) - Shorthand Property names #298

Open viphat opened 6 years ago

viphat commented 6 years ago
var a = 'foo', b = 42, c = {};
var o1 = { a: a, b: b, c: c }
var o2 = { a, b, c }
console.log(o1 === o2) // false
console.log(o1.a === o2.a) // true 
console.log(o1.b === o2.b) // true
console.log(o1.c === o2.c) // true