typeof 运算符可以识别所有的基本数据类型、函数、可以识别是否是引用数据类型。例:
let str = "Hello JavaScript";
let m = 100;
let isMarry = true;
let unique = Symbol("unique");
let n = undefined;
function fn() {}
let arr = ["a", "b"];
let obj = { name: "张三" };
let empty = null;
console.log(typeof str); // "string"
console.log(typeof m); // "number"
console.log(typeof isMarry); // "boolean"
console.log(typeof unique); // "symbol"
console.log(typeof n); // "undefined"
console.log(typeof fn); // "function"
console.log(typeof arr); // "object"
console.log(typeof obj); // "object"
console.log(typeof null); // "object"