之前只顾着写代码,很多基础知识没搞懂。现在重新梳理一下,便于自己知识回顾。
1、1)String、Number、Boolean、Null、Undefined、Symbol; 原始数据类型
2)Object~~、Function、 Array(都属于对象)~~ 、;引用数据类型
3)如果定义了一个变量,但没有给它赋值,这个变量将返回undefined
2、数据类型检测
- typeof;可以检测出String、Number、Boolean、Function、undefined、object;Array和null会输出’object’
2)instanceof,返回true or false
3)constructor
4)Object.prototype.toString.call()
具体可查看https://www.cnblogs.com/zt123123/p/7623409.html