Lets say I have this code:
const {x, y} = point;
Babel will turn this into:
var _point = point, x = _point.x, y = _poin
To handle undefined error in ES6 object destructuring, you can do something like following
const {x, y} = {...point}; console.log(x) // undefined console.log(y) // undefined