Question 11
Consider the below javascript program, and predict the output, if executed.
let x = 50;
const obj1 = { x : 10, func : function (x) { console.log(x, "and", this.x) }}
const obj2 = { x : 20, func : function () { console.log(x, "and", this.x) obj1.func.call(this) }}
obj2.func.call(obj1)50 and 10
undefined and 2050 and 10
undefined and 1050 and 20
50 and 2020 and 10
50 and 10