ITeye博客

Execution Context in JavaScript

standalone · 2013-01-18 22:46 · javascript · 编程语言 · Markdown

Do you 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 article.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。