What will be the output of the following code?
const obj1 = { name: "John", age: 30 };
const 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 = { ...obj1 };
obj2.age = 35;
console.log(obj1.age);