this
this
함수호출
function func(){
if(window === this){
document.write("window === this");
}
}
func();
// this는 전역객체인 window와 같다.
// 결과 window === this메소드의 호출
var o = {
func : function(){
if(o === this){
document.write("o === this");
}
}
}
o.func();
// o === this생성자의 호출
apply, call
Last updated