<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
var num = 12;
console.log(typeof num);//number
var str = 'qwe';
console.log(typeof str);//string
var flag = true;
console.log(typeof flag);//boolean
var vari = undefined;
console.log(typeof vari);//undefined
var timer = null;
console.log(typeof timer);//object
</script>
</head>
<body>
</body>
</html>
![](https://img-blog.csdnimg.cn/2021040319393138.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3NoaW5pYW5fYWNtZXI=,size_16,color_FFFFFF,t_70)
也可以根据操作台颜色判断,Number型zise,String型黑色,true深蓝色,null和undefined灰色。