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的類型,什麼都不是"object, array,null"
- 實現這個的最好方法是什麼?如何獲得確切的typeof是object/array/null ..?