typeof、instanceof、Object.prototype.toString.call() 区分对象类型
typeof
.基本数据类型:number,string,undefined,boolean,object 五种。
用法: typeof(变量名)
1 var test1= 1;
2 alert(typeof test1);//输出number
3 var test2 = “”;
4 alert(typeof test2);//输出string
5 var test3 = undefined;
6...
原创
2019-10-16 14:53:23 ·
758 阅读 ·
0 评论