Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaScriptthis in callbacks vs methodsSingle-choice MCQ

Inside a method, an array is processed with `.map(function(){ return this.v; })` (a regular function callback). What does `this` refer to inside that callback in strict mode?

const obj = { v: 42, run() { return [1].map(function () { return this.v; })[0]; } }; obj.run();