基本数据类型:
number:数字/数值
string:字符串
boolean: 布尔(值true/false)
undefined:未定义(变量声明未赋值,未获取数值)
null:空(值为0)
检测方法:typeof
引用(复杂)数据类型:
object(对象),array(数组),function(函数)
检测方法array instanceof array`
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
</head>
<body>
<script type="text/javascript">
var arr=[1]
console.log(typeof arr)//结果object
console.log(arr instanceof Array)//结果true
</script>
</body>
</html>