您的位置:首页 > Web前端 > JavaScript

JavaScript中的基本数据类型

2017-10-11 09:59 295 查看
JavaScript中数据类型有六种分别是:

Number ,

String,

Boolean,

null,

undefined以及一个混合数据类型Object(Date,function,Array。。。)

其中使用typeof返回数据类型的情况只有null是个例外:

typeof Symbol()    //"symbol"
typeof Number()    //"number"
typeof String()    //"string"
typeof Function()    //"function"
typeof Object()    //"object"
typeof Boolean()    //"boolean"
typeof null    //"object"
typeof undefined    //"undefined"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息