If you open chrome devtool and enter the following:
// The iife is irrelevant
let r = (() => { return 2; })();
and then evaluate r
you'll see:
r
2
but window.r
and globalThis.r
both return undefined
. I know let
is block scoped but where is the r
parent object? What block am I in, in the devtool that I can access r
directly but it's not on any global object?