1
다음은 JavaScript의 신비주의 동작입니다. 사용상의 실수 나 버그가 있습니까?자체 변수의 JavaScript miss context
https://jsfiddle.net/stanislavmachel/f44zbvvr/8/
누군가가 설명 할 수없는 이유를 호출 한 후 자기 변수 미스의 상황 :
function test(){
var self = this;
self.func1 = function(){
debugger; // here self == Window
}
debugger; //here self == test func
self.func1();
}
var t = new test();
자바 스크립트 코드 난 당신이 스스로 그것을 시도 할 수 JSfiddle를 제공?
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/this – Korgen