← Back to archive

Stdle #128 · scope · 2026-10-06

What does this JavaScript snippet output?

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

function add(a, b) { return a + b; }
console.log(add.call(null, 2, 3));
console.log(add.apply(null, [4, 5]));
Scope
2 lines
4 attempts left

Answer & explanation