web前端技术博客
您当前的位置:web前端 > JavaScript知识点

JavaScript 7种内置类型

作者:只会切图的前端 发布时间:2021-01-03 11:16:39 浏览量:18

js的7种内置类型:
1、null (空值)
2、undefined (未定义)
3、boolean (布尔值)
4、number (数字)
5、string (字符串)
6、object (对象)
7、symbol (符号,ES6新增)

string、boolean、number、null、undefined属于简单基本类型

使用typeof运算符查看值类型,它返回类型的字符串值。

typeof运算符


注意:

typeof null === "object"
typeof []==="object"
typeof new Date() ==== "object"
typeof function(){} ==="function"


 

发表评论
验证码:
联系我
粤ICP备17092958号