3 ms·
> Because even though the if-block is not executed, the line 4 still redefines var x as undefined. This is because of hoisting. Not quite right as described.
by bpicolo 10y ago
> Because even though the if-block is not executed, the line 4 still redefines var x as undefined.
This is because of hoisting. Not quite right as described.
- fenomas 10y agoYeah, that example should be changed - the "before" version isn't code anyone would write on purpose, and which JSHint/JSLint would flag as a bug.