JavaScript中的基本数据类型

来源:互联网 发布:武当山釒殿的建筑数据 编辑:程序博客网 时间:2024/06/01 23:29

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"



原创粉丝点击