Passed in undefined argument in jQuery core source code

廉价感情. 提交于 2019-11-29 13:22:23

Undefined is a type but is also a global variable.

You can have a module that overwrites the value of undefined by doing undefined = whatever.

jQuery uses a immediate function to scope window and undefined.

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/undefined

Since someone could overwrite undefined like this

undefined = true;

Code of your immediate function will pass it as it should be (stay undefined). I think it's mentioned in 10 Things I Learned from the jQuery Source.

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