js判断对象类型的两种方法

在js 中 , 有一种判断数据基本类型的方法 typeof , 只能判断5中基本类型:即 “number”,”string”,”undefined”,”boolean”,”object” 五种。javascript 用法为:java typeof 1 typeof str console.log(typeof 1) //打印出 number typeof 'a' == 'string'
相关文章
相关标签/搜索