3 ms·
The JS interpreter shares your preference of writing all var declarations at the top - in fact, at interpretation time they will be "hoisted" to the top of the
by thedaniel 14y ago
The JS interpreter shares your preference of writing all var declarations at the top - in fact, at interpretation time they will be "hoisted" to the top of the scope. In other words:
foo()
var bar = 1;
is actually run as
var bar;
foo();
bar = 1;
- tomjen3 14y agoTrue, and that was part of what I was trying to articulate.