您的位置:首页 > 其它

typeof检测到的数据类型有哪些?

2017-08-22 17:54 176 查看
javascript共有6种数据类型:(基本类型5种)number、string、boolean、null、undefined
 。(引用类型1种) object

typeof检测返回6种:
undefined、boolean、string、number、object、function

注:null是一个只有一个值的特殊类型。表示一个空对象引用。用typeof检测返回是object。

typeof(undefined
)  // undefined

typeof(null)
 //  object

typeof(0)
   //  number

typeof(false)
 // boolean

typeof("")
   // string
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: