destructure object and assign all to new object javascript code example Example: destructure to object ({x: oof.x, y: oof.y} = foo);