thisの違い

当たり前かもしれないけど

var test = {
    test : function(){
        return this;
    }
}

function test02(){
    return this;
}

console.log(test.test()); //Object (test自身)
console.log(test02()); //DOMWindow

 

Comments are closed.