Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 354 Bytes

enhanced-object-literals.md

File metadata and controls

30 lines (21 loc) · 354 Bytes

Enhanced Object Literals

Robbie Wagner, Daniel Luu, Kevin Lee

###ES5

var foo = 'foo';

var obj = {
  foo: foo,
  test: function() {return "test";}
};

obj["bar" + func()] = "baz";

##ES2015

const foo = 'foo';

const obj = {
  foo,
  test() {return "test";},
  ["bar" + func()]: "baz";
};