가능한 중복 :
자바 스크립트의 나쁜 일부가 될 수 있지만,이 조각을보고있는 것으로 간주 "자바 스크립트 좋은 부품",
Are there legitimate uses for JavaScript's “with” statement?with 키워드는 javascript에서 좋지 않습니까?with
에서
:
var foo={foof:function(){console.log(this)}}
var fuu={fuuf:function(){console.log(this)}}
with(foo){
console.log(this);
with(fuu){
console.log(this);
foof();
fuuf();
}
}
with
은 정말 그렇게 나쁜 습관입니까? with
가끔 재미를 줄 수 있습니까? 예를 들어 줄 수있는 사람이 있습니까?
'with'는'this' 포인터를 변경하지 않습니다. 질문이 뭐야? –