Hoisting example
by Sean Cannon
JavaScript
var foo = 'Hello world';
(function(){
alert(foo);
var foo = 'Goodbye world';
alert(foo);
})();
by Sean Cannon
var foo = 'Hello world';
(function(){
alert(foo);
var foo = 'Goodbye world';
alert(foo);
})();