• 关于undefind


    var undefined = "东方云游";
    alert(undefined);   // undefined 不一定为undefined ie8(包含ie8)以下会返回 "东方云游"

    首先全局作用域的undefined是window下面的一个属性,这个属性对于一般的浏览器是不能被修改的。但是在ie8(包括ie8)以下则可以被修改。

    (function(){
        var undefined = "东方云游";
        alert(undefined);   // 东方云游
    })()
    

    然后以函数自执行的形式即一个局部环境中定义了一个变量undefined(注意这个时候它不再是window下的属性),其实它和普通的变量没有什么差别,就是一个声明赋值的情况,所以不管在哪个浏览器中输出都是 "东方云游"

    也就是说:
    全局环境中:undefined是window下的属性,在绝大部分浏览器中是不能被修改的(ie8包括ie8可以被修改)
    局部环境中:undefined和普通的变量没有太大的差别,所以可以像其他变量一样使用

    jQuery 中:

    strundefined = typeof undefined,//新的jQ中直接使用undefined,因为不支持ie678了。
    strundefined = "undefined",
    那不直接用"undefined"是因为利于压缩么?
    是用于避开 分词时对关键字的处理,这是编译原理的东西,一段代码,先进行分词,转换成AST(抽象语法树),简单来说,就是有利于浏览器的JS 引擎对用户代码进行优化。

    嗑嗑,undefined不是关键字。

    因为这个吧:https://bugs.jquery.com/ticket/14543#comment:2
    strundefined was introduced to work around a ​minification issue with UglifyJS that replacedtypeof el.domMethod !== "undefined" with e.domMethod!==void 0, which breaks in IE when el is an XML node (see #13315). The issue has since been fixed, so it's worth looking at the effects on output size of comparing typeof output to variables or constants for all cases. Would you like to tackle this, FarSeeing?


    http://202.197.191.206:8080/05/text/chapter02/section3/index1_bq.htm


    当识别到字母开头的字母数字串时,先查关键字表。若查不到则为标识符,查到则为关键字。词法分析什么的。


    大牛真是活词典。。。。

  • 相关阅读:
    svn服务器
    TCopyDataStruct 各个参数意义
    Com+连不上解决办法
    流的压缩与解压缩
    Config 文件的增删改查
    Assembly 操作
    redhat7 安装oracle11.2.4页面显示不全解决方法
    IEnumerator和IEnumerable详解
    [我的阿里云服务器] —— 安装LAMP
    设计模式之二抽象工厂设计模式
  • 原文地址:https://www.cnblogs.com/darr/p/5116470.html
Copyright © 2020-2023  润新知