var obj = {},ar = [],nothing=null,empty=undefined,word ='string',headorTail = true;
console.log(typeof obj) //object
console.log(typeof ar)//object
console.log(typeof nothing)//object
console.log(typeof empty)//undefined
console.log(typeof word)//string
console.log(typeof headorTail)//boolean
但是我怎样才能得到 obj,ar,nothing 的类型"object, array,null"
- 实现这一目标的最佳方法是什么?