Lambda saysScope is where a variable is visible: global, function, or block.
Variables declared inside a function or block ({ }) are local to it. let/const are block-scoped; var is function-scoped (ignores blocks). Inner scopes can read outer variables (the scope chain), but outer scopes can't see inner ones. Minimize globals — they cause name clashes and bugs.
Power-ups you unlock
Global / function / block scope
let/const block-scoped; var function-scoped
Inner scopes see outer (scope chain)
Minimize globals to avoid clashes
The Mutator attacks — common mistakes
Leaking variables to global by forgetting let/const
Expecting var to respect block scope
Shadowing an outer variable unintentionally
Boss battleShow a block-scoped let that is invisible outside its block.
Example code
<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre id="o"></pre>
<script>let out=''; { let secret='block-only'; out=secret; } // secret not visible here
document.getElementById('o').textContent='captured inside block: '+out;</script></body></html>