Execution Cotext in JavaScript

627 ワード

Dou know the output of the code below:

(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
アーティスト.