object destructuring: how to use intermediate nested property

The closest I can come up with is:

var { iWantThis, iWantThis: { andThis, andThisToo } } = x;

Though I’d use let instead, if I’m using ES6 😉

Leave a Comment