围绕现代化源代码,我发现了奇怪的事情:

window.Modernizr = (function(window,document,undefined) {

之后,此功能将带有两个参数(this, this.document).

为什么 undefined 在这里使用吗?它有意义还是只是奇怪的代码风格?

有帮助吗?

解决方案

创建本地 undefined 如果有人重新定义 undefined 示波器链中的某个地方。

也提供更快的查找 undefined 是全球性能,因此范围链遍历减少。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top