JSLint says new keyword is missing [duplicate]

落花浮王杯 提交于 2019-12-05 17:09:23

It is the convention that constructors (eg: Array, Object) are starting with a capital.

JSLint complains, because it thinks that you're trying to use a constructor, without new keyword. To fix the problem, start your function with a non-uppercase character.

JSLint thinks the function is a constructor since it's uppercase. Name your non-constructor functions with an initial lowercase letter and JSLint will stop complaining.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!