0
내가 변수가 this.current_test = null;
로 내 함수의 맨 위에 선언 한 후 선 아래로 나는 setInterval을 기능을 가지고 있고이 새 매개 변수에 변수를 설정해야합니다 ...하여 setInterval 변수 범위
this.current_test.failed = true;
코드 :
나는TypeError: 'undefined' is not an object (evaluating 'this.current_test.failed = true'
오류
을 얻고 그러나
timer = this.window.setInterval(function()
{
this.window.clearInterval(timer);
this.current_test.failed = true;
},1000);
}
그리고 나는이 일 가정 왜냐하면 this.current_test가 setInterval 함수 내에 정의되어 있지 않기 때문에 어떻게 그 변수를 편집 할 수 있습니까?
코드를 더 게시 할 수 있습니까? 특히'current_test'를 정의하는 부분. –