Question PRG-JS-0062
HardWhat is the output of this program?
const obj = {
name: "A",
regular() { return this.name; },
arrow: () => typeof this,
delayed() { return [1].map(() => this.name)[0]; }
};
const f = obj.regular;
console.log(obj.regular(), obj.delayed(), obj.arrow(), typeof f);
- A.
A A object undefined
- B.
A undefined object function
- C.
Sign up free to see the answer and a step-by-step explanation.