<script language=javascript>
var a=new Array(1,2,3)
alert(a.constructor);
</script>

解决方案 »

  1.   

    使用函数typeof
    typeof 返回六种可能的值:“数字类型”、“字符串类型”、“布尔型”、“对象类型”、“函数类型”和“未定义类型”。
    数组为认为一种object类型<script language=javascript>
    var a=new Array(1,2,3);
    var b=2;
    var c="2eee";document.write("  The type of  is " + typeof(a) );
    document.write("  The type of  is " + typeof(b) );
    document.write("  The type of  is " + typeof(c) );
    alert(a.length);</script>
      

  2.   


    function func1(a){
       if(a!=null){
           if(a.length){
               alert("array";
           }else{
               alert("is not array")
            }
    }
    }
      

  3.   

    var a="2eee";调用
    function func1(a){
       if(a!=null){
           if(a.length){
               alert("array";
           }else{
               alert("is not array")
            }
    }
    }
    出来的结果是"array"
    --------------------------
    <script>
    var a=new Array(1,2,3);
    var b=2;
    var c="2eee";document.write("  The type of  is " + typeof(a) );
    document.write("  The type of  is " + typeof(b) );
    document.write("  The type of  is " + typeof(c) );
    //alert(a.length); if(c!=null){
           if(c.length){
               alert("array");
           }else{
               alert("is not array")
            }
    }
    </script>
      

  4.   

    哦,我那个只能判断obiect和obiect array