zoukankan      html  css  js  c++  java
  • [ActionScript3.0] 逻辑或"||=" ,等于"=="和全等于"==="

    function a(o:Object):void {  

      o||=new Object();  trace(o);

    }

    //此上下两个方法作用是一样的

    function b(o:Object):void {  

      if(o === null){   

        o = new Object();  

      }  trace(o);

    }

    拓展:

    等于"==" :比较两个值是否相等,当被比较的值类型不同时自动进行转换

    "hello" == "hello"       //true

    "5" == 5                     //true

    true == 1                   //true

    false == 0                  //true

    "true" == true             //false

    null == undefined       //true

    全等于"===" :比较两个数据的值和数据类型是否都相等

    "hello" == "hello"       //true

    "5" == 5                     //compile error

    true == 1                   //false

    false == 0                  //false

    "true" == true            //false

    null == undefined      //false

    ------------------------------------------------------------------ Always put yourself in the other's shoes.If you feel that it hurts you,it probably hurts others,too.------------------------------------------------------------------
  • 相关阅读:
    java System.getProperty()参数大全
    元类(转自https://zhuanlan.zhihu.com/p/23887627)
    正则(高级)(转)
    正则(转)
    机器学习入门之房价预测(线性回归)
    python字节码(转)
    在虚拟机中搭建django,通过外网访问
    django框架入门
    linux下创建虚拟环境(转)
    PAT1005
  • 原文地址:https://www.cnblogs.com/frost-yen/p/4291993.html
Copyright © 2011-2022 走看看