javascript 数据类型

一、js一共六种数据类型:包括五种原始数据类型》number/string/boolean/null/undefined一种对象类型》object》Function/Array/Date...

二、类型转换:1.typeof : typeof 100>number/typeof  true>boolean/typeof function > function /typeof null > object

三、类型检测:1.funciton 和 原始数据类型用 typeof ,遇到null失效,用严格等于2.对象如数组等用instanceof3.Object.prototype.toString得到类型。

posted @ 2018-08-27 15:46  雨停了  阅读(92)  评论(0编辑  收藏  举报