안녕하세요! 강의를 듣다가, 똑같이 코드를 작성했는데요.
for (let i = 0; i < 3; i++){
$('.tab-button').eq(i).on('click', function(){
$('.tab-button').removeClass('orange');
$('.tab-button').eq(i).addClass('orange');
$('.tab-content').removeClass('show');
$('.tab-content').eq(i).addClass('show');
});
}
아래와 같은 에러가 뜹니다! 혹시 이 에러가 뜨는 이유가 뭘까요? 해결책도 알려주시면 감사하겠습니다!
Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (i) jshint (W083)