0
What is the output of the following JavaScript code?
const o = {a: 1, b: {c: 2}};
const p = {...o};
p.b.c = 9;
p.a = 5;
console.log(o.a, o.b.c);- A5 9
- B1 9
- C1 2
- D5 2
Correct answer: B
What is the output of the following JavaScript code?
const o = {a: 1, b: {c: 2}};
const p = {...o};
p.b.c = 9;
p.a = 5;
console.log(o.a, o.b.c);