js判断数据类型

来源:互联网 发布:开源 量化交易软件 编辑:程序博客网 时间:2024/06/05 08:51
var test = [];if (test.constructor==Array){    console.log("This is an Array");}if (test.constructor==Boolean){    console.log("This is a Boolean");}if (test.constructor==Date){    console.log("This is a Date");}if (test.constructor==String){    console.log("This is a String");}
0 0