Question 14
Consider the below JavaScript program.
const property1 = 10;const obj1 = { property1: 20, property2: function () { console.log(property1, this.property1); return this.property1; }}
const obj2 = { property1: 30, property2: () => { console.log(property1, this.property1); console.log(this.property2); }}obj2.property2();What will be the output of the above program, if executed?
10 30
2010 30
undefined10 undefined
3010 undefined
undefined10 30
10 20
2010 undefined
10 undefined
undefined