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