zoukankan      html  css  js  c++  java
  • JavaScript中的null和undefined

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title>null undefined</title>
    </head>
    <body>
    <script type="text/javascript">
            //<![CDATA[


            var a;
            var b = null;


            document.write( a + "<br/>" );  //因为a未定义具体是值,所以是undefined
            document.write( b + "<br/>" );


            document.write( undefined == true );
            document.write( "<br/>" );
            document.write( undefined == "" );
            document.write( "<br/>" );
            document.write( undefined == 0 );
            document.write( "<br/>" );
            document.write( undefined == -0 );
            document.write( "<br/>" );
            document.write( undefined == NaN );
            document.write( "<br/>" );
            document.write( undefined == null ); //在某些时候他们两个比较是相等的
            document.write( "<br/>" );
            document.write( 1985 === "1985" );


            //]]>
        </script>
    </body>
    </html>
    Meet so Meet. C plusplus I-PLUS....
  • 相关阅读:
    HDU 2509 nim博弈
    HDU 1907 nim博弈变形
    HDU 1568 double 快速幂
    HDU 5950 矩阵快速幂
    HDU 1796 容斥原理
    Linux raid信息 查看
    Linux Ubuntu 内核升级
    Ubuntu 14.04 为 root 帐号开启 SSH 登录
    Google 分布式关系型数据库 F1
    分布式事务实现-Spanner
  • 原文地址:https://www.cnblogs.com/iplus/p/4490026.html
Copyright © 2011-2022 走看看