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

前端 未结 8 1898
我在风中等你
我在风中等你 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:47

    Keep in mind that JSLint enforces one persons idea of what good JavaScript should be. You still have to use common sense when implementing the changes it suggests.

    In general, comparing type and value will make your code safer (you will not run into the unexpected behavior when type conversion doesn't do what you think it should).

提交回复
热议问题