← Back to archive

Stdle #122 · scope · 2026-09-30

What does this JavaScript snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

const obj = {
v: 3,
m() { return (() => this.v)(); }
};
const fn = obj.m;
console.log(obj.m(), typeof fn);
Scope
4 attempts left

Answer & explanation