illustrating var hoisting
by nickkell
JavaScript
(function() {
var first = (function() {
console.log("will log undefined", second);
}()),
second = "second";
}());
by nickkell
(function() {
var first = (function() {
console.log("will log undefined", second);
}()),
second = "second";
}());