22

Huh. ES6's variable destructuting on objects is actually pretty cool.

var {foo, bar, baz} = obj

Is functionally equivalent to this:
var foo = obj.foo
var bar = obj.bar
var baz = obj.baz

I like it! Makes things simpler.

Comments
  • 0
    @BassClefBuddha best explanation? What others have you seen?
  • 1
    @BassClefBuddha destructuring is pretty easy to sum up in a very short sentence though...

    "the act of binding variables based on the structure of an object"
  • 0
    @angery I used var to keep it familiar to non-es6 readers
Add Comment