您的位置:首页 > Web前端 > JQuery

jQuery源码分析系列 学习记录

2014-02-20 11:02 417 查看
最近在跟nuysoft jQuery源码分析系列 ,把不深入的知识点自己做些摘要取出来,记录下。

1. 函数自调用括号有两种写法(仔细看括号的位置):

(function() {
console.info( this );
console.info( arguments );
}( window ) );         //(foo{}());

(function() {
console.info( this );
console.info( arguments );
}) ( window ));       //(foo{})();


2. undefined可以被重写,必要时需要显式赋值.


在在参数列表中增加undefined呢?

在 自调用匿名函数 的作用域内,确保undefined是真的未定义。因为undefined能够被重写,赋予新的值。

undefined = "defined";
console.log(undefined);


  测试结果: ie7/8/9: "defined";

chrome 32,firefox26: "undefined"


3.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: