Shallow copy

Report a typo

Make a shallow copy of the object below:

// You should get:
console.log(man === shallowCopy) //false
console.log(man.mother === shallowCopy.mother) //true

Sample Input 1:

Sample Output 1:

false
true
Write a program in JavaScript
const man = { name: 'John', mother: { name: 'Bella'} };
const shallowCopy = //write your code here
___

Create a free account to access the full topic