标签:
JavaScript共有5种原始类型undefined、null、boolean、number和string。
1 //typeof函数输出的一共有几种类型 2 console.log(typeof(a)); //undefined 3 console.log(typeof(10)); //number 4 console.log(typeof("zhang")); //string 5 console.log(typeof(true)); //boolean 6 7 console.log(typeof(function fn(){})); //function 8 console.log(typeof({name:"sere",age:11})); //object 9 console.log(typeof(new Number(11))); //object 10 var bb = null; 11 console.log(typeof(bb)); //object
标签:
原文地址:http://www.cnblogs.com/sere/p/4775057.html