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.------------------------------------------------------------------
  • 相关阅读:
    第一章epoll
    sk_buff结构--转载
    邻居子系统1.5 neigh output
    netfilter内核态与用户态 通信 之 sockopt
    邻居子系统1.4
    邻居子系统 1.3
    邻居子系统 1.2
    邻居子系统 1.1
    linux 内核 tasklets 原理以及工作队列
    linux 内核 同步原理
  • 原文地址:https://www.cnblogs.com/frost-yen/p/4291993.html
Copyright © 2011-2022 走看看