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.------------------------------------------------------------------
  • 相关阅读:
    Linux 命令查找文件中某个字段所存在的位置
    PHP in_array() 函数
    php一维数组如何追加到二维数组
    电脑切换窗口
    微擎前端逻辑判断的时弹框
    JDBC批量处理
    数据库事务
    处理BLOB
    JDBC自动生成主键值
    JDBC的元数据
  • 原文地址:https://www.cnblogs.com/frost-yen/p/4291993.html
Copyright © 2011-2022 走看看