//number,string,boolean,null,undefined,symbol
var num1=12
var str1='ab'
var bool1=true
var nul1=null
var udf1
//object
var obj1={ name:1}
var arr1=[1,2,3]
function a(){}
console.log('typeof---------------------------')
//typeof(检测数据类型的运算符)
console.log(typeof(num1))
console.log(typeof(str1))
console.log(typeof(bool1))
console.log(typeof(nul1))
console.log(typeof(udf1))
console.log(typeof(obj1))
console.log(typeof(arr1))
console.log(typeof(a))
console.log(typeof NaN) //返回number
console.log('instanceof---------------------------')
//instanceof(可以正确监测对象类型(引用数据类型,不能判断基本数据类型),判断它的原型链上有没有某类型的原型)
console.log(bool1 instanceof Boolean)
console.log(num1 instanceof Number)
console.log(arr1 instanceof Array)
console.log(obj1 instanceof Object)
console.log(a instanceof Function)
console.log('constructor---------------------------')
//constructor判断某实例和类的关系
console.log(num1.constructor===Number)
console.log(arr1.constructor===Array)
console.log(a.constructor===Function)
console.log('Object.prototype.toString.call()---------------------------')
//Object.prototype.toString.call()
var b=Object.prototype.toString
console.log(b.call(num1))
console.log(b.call(str1))
console.log(b.call(bool1))
console.log(b.call(nul1))
console.log(b.call(udf1))
console.log(b.call(a))
console.log(b.call(arr1))
console.log(b.call(obj1))
console