Do you know the output of the code below:
If you are not clear about this question, please read this [url=http://davidshariff.com/blog/what-is-the-execution-context-in-javascript/]article[/url].
(function() {
console.log(typeof foo); // function pointer
console.log(typeof bar); // undefined
var foo = 'hello',
bar = function() {
return 'world';
};
function foo() {
return 'hello';
}
}());
If you are not clear about this question, please read this [url=http://davidshariff.com/blog/what-is-the-execution-context-in-javascript/]article[/url].