- 1
what is the output of this code?
const obj1 = { a: 0 b: 2 c: 4 }; const obj2 = Object.assign({c: 5, d: 6}, obj 1); console. log(obj2.c, obj2.d);
2 Answers
+ 3
Obj2 is created and assigned values c:5,d:6,then total obj1 values to obj2 values overriding existing ones...
So obj2 = { a:0,b:2,c:4,d:6}
So output : obj2.c = 4, obj2.d = 6 output. 4 6
0
4,6



