In your shallow Copy() function, write an Object.assign() method and pass two arguments to it: A new empty object as the target The source object that you wish to copy code example
Example: javascript clone object
var x = {myProp: "value"};
var xClone = Object.assign({}, x);
//Obs: nested objects are still copied as reference.