zoukankan      html  css  js  c++  java
  • typeof应该注意的地方(网龙公司校招笔试题)

     1 <script language="javascript" type="text/javascript"> 
     2   alert(new String('a')==='a');       //true
     3   alert(Function instanceof Object);//true
     4   alert(NaN!==NaN);                     //true
     5   alert(typeof []==='Object');        //false
     6 </script>
     7 
     8 <script language="javascript" type="text/javascript"> 
     9   alert(new String('a')==='a');          //true
    10   alert(Function instanceof Function);//true
    11   alert(NaN!==NaN);                        //true
    12   alert(typeof []==='object');           //true
    13 
    14     alert(typeof(typeof [])==='string');//true
    15 </script>

    注意:Function instanceof Object/Function instanceof Function都是true;typeof返回的值是String类型并且全部是小写的,所以typeof []==='Object'返回的是false

  • 相关阅读:
    子网划分详解
    USACO range
    USACO shopping
    USACO fence
    USACO Spinning Wheels
    USACO butter
    USACO msquare
    USACO Feed Ratios
    USACO Stringsobits
    USACO Factorials
  • 原文地址:https://www.cnblogs.com/cdwp8/p/4050325.html
Copyright © 2011-2022 走看看