js的數據類型有:
原始數據類型:string number undefined null boolean
引用數據類型:Object ***
檢測這些數據類型的方法:
typeof檢測,可以返回:string number undefined boolean object function
typeof檢測null 返回object
typeof檢測[ ] 返回object
typeof檢測number 返回object
它們都返回object,如何區分:
Object.prototype.toString.call(需要檢測的數據);
返回:[Object 數據的類型]