JavaScript 学习笔记之操作符(续)(3)


  <script type="text/javascript">
         var num1 = 5;
         var num2 = 10;
         var message = "The sum of 5 and 10 is " + num1 + num2;
         alert(message); 
    </script>

复制代码 代码如下:


<script type="text/javascript">
        alert(null == undefined);   
        alert(null === undefined);  
        alert("NaN" == NaN);      
        alert("NaN" === NaN);     
        alert(NaN == NaN);        
        alert(NaN === NaN);       
        alert(NaN != NaN);       
        alert(NaN !== NaN);        
        alert(false == 0);      
        alert(false === 0);      
        alert(true == 1);       
        alert(true === 1);    
        alert(null == 0);        
        alert(undefined == 0);   
        alert(5 == "5");         
        alert(5 === "5");                  
    </script>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wgxzwz.html