梦见世界

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

原因一: 由于undefined并不是保留字 ,在ie8及ie8之前是可以直接赋值的

原因二:  在函数中如果undefined作为函数参数,则会有可能出错,像下面这样,经chrome49.0测试会出现该问题 所以谨慎一点别用undefined,

     不谨慎的话也别把undefined这么用。

var foo = function (undefined) {

    "use strict";

    var x = "foo";
    console.log(x); // "foo"
    var x = undefined;
    console.log(x); // "oops"

};

foo('oops');

 

posted on 2016-03-10 23:49  梦见世界  阅读(212)  评论(0编辑  收藏  举报