JSLint Expected '===' and instead saw '=='

前端 未结 8 1913
我在风中等你
我在风中等你 2020-11-30 21:08

Recently I was running some of my code through JSLint when I came up with this error. The thing I think is funny about this error though is that it automatically assumes tha

8条回答
  •  孤街浪徒
    2020-11-30 21:44

    A quote from http://javascript.crockford.com/code.html:

    === and !== Operators.

    It is almost always better to use the === and !== operators. The == and != operators do type coercion. In particular, do not use == to compare against falsy values.

    JSLint is very strict, their 'webjslint.js' does not even pass their own validation.

提交回复
热议问题