Question 16
Consider the below javascript program.
const a = 2;const b = "";
const obj1 = { property1: 10, property2: 20}
const obj2 = { a: 1, b: 2, ...(a && !b && { obj1 })};
console.log(obj2);What will be the output of the above program, if executed?
{ a: 1, b: 2, property1: 10, property2: 20 }
{ a: 1, b: 2, obj1: { property1: 10, property2: 20 } }
{ property1: 10, property2: 20 }
{ a: 1, b: 2 }