基本数据类型
1.分类
-
基本(值)类型
String // 任意字符串 Number // 任意数字 boolean // true/false undefined // undefined null // null
-
对象(引用类型)类型
Object // 任意对象 Function // 一种特别的对象 (可以执行) Array // 一种特别的对象(数值下标,内部数据是有序的)
2.判断
typeof // 返回数据类型的字符串表达
// 可以判断 undefined / 数值 / 字符串 / 布尔值
// 不能判断:null与object object与array
//ex:
console.log(a,typeof a) // undefined ‘undefined'
instanceof // 判断对象的具体类型
=== // 可以判断:undefined,null