[…] what if point is undefined? Now I get an error: "Cannot read property 'x' of undefined"
So how do I avoid this?
If you want to write clear code, you can explicitly check that condition:
let { x, y };
if (typeof point === 'undefined') {
x = y = undefined;
} else {
{ x, y } = point;
}