ES6 Object Literal Features in Depth (Ponyfoo)
ES6 Object Literal Features in Depth
Use computed property names:
var foo = 'bar'
var baz = { [foo]: 'ponyfoo' }
console.log(baz)
Infer property names:
function getItem(){//...}
function setItem(){//...}
function clear(){//...}
module.exports = { getItem, setItem, clear }
Method definitions
var foo = {
baz () {
// foo.baz()
}
}
of course there's already get
and set