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

Given this code, what is logged and why does the arrow vs regular distinction matter here?

const obj = { v: 42, run() { (() => console.log(this.v))(); (function () { console.log(this && this.v); })(); } }; obj.run();