What will be the output of the following code?
const obj1 = { name: "John", age: 30 };
const obj2 = { ...Object.getPrototypeOf(obj1), ...obj1 };
delete obj2.name;
console.log(obj1.name);
What will be the output of the following code?
const obj1 = { name: "John", age: 30 };
const obj2 = { ...Object.getPrototypeOf(obj1), ...obj1 };
delete obj2.name;
console.log(obj1.name);