Last updated 2 years ago
Was this helpful?
JS ⟩ variable ⟩ shadowing ⟩ let can't shadow parameter even in sloppy mode.
✅let can't shadow parameter(s) even in sloppy mode❗
function declaration instantiation
lexical environment
parameter / argument
✅
❗
replit:let can't shadow parameters
'use strict'; // ⭐ toggle sloppy/strict mode const { log } = console; // ⭐ only "simple" parameters // "parameters" / "body declarations" in the same environment record. function f(x) { let x = 1; // ⛔ SyntaxError
JS spec ⟩
FunctionDeclarationInstantiation
Function Environment Record
shadowing parameters by local variables? (my question)
Where are arguments positioned in the lexical environment? ⭐️
YDKJS: Scope & Closures (v.2) ⟩ Ch. 8 ⟩ Parameter Scope