how to deep copy object in javascript

JavaScript
let a = { x: 10, y: 15 };
let b = Object.assign({}, a);
console.log(a);
//output: { x: 10, y: 15 }
console.log(b);
//output: { x: 10, y: 15 }
console.log(a === b);
//output: false
Source

Also in JavaScript: