how to clone objects code example
Example 1: clone javascript object
let clone = Object.assign({}, objToClone);
Example 2: javascript clone object
let clone = Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
let clone = Object.assign({}, objToClone);
let clone = Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));