JavaScript的数据类型

字符串 String、数字 number、布尔 boolean、对象 Object、Null、Undefined

注意

1.Undefined 与 null 的值相等,但类型不相等

2.原始数据

typeof 运算符可返回以下原始类型之一:

string number boolean undefined

3.复杂数据

typeof 运算符可返回以下两种类型之一:

function bject

typeof 运算符把对象、数组或 null 返回 object。

typeof 运算符不会把函数返回 object。

typeof 运算符把数组返回为 "object",因为在 JavaScript 中数组即对象。

原文地址:https://www.cnblogs.com/kawayi/p/14413397.html