What does the JSLint error 'body of a for in should be wrapped in an if statement' mean?

后端 未结 8 871
长情又很酷
长情又很酷 2020-11-30 15:57

I used JSLint on a JavaScript file of mine. It threw the error:

for( ind in evtListeners ) {

Problem at line 41 character 9:

8条回答
  •  臣服心动
    2020-11-30 16:40

    This means that you should filter the properties of evtListeners with the hasOwnProperty method.

提交回复
热议问题