类型判断 
typeOf 
根据 Object.prototype.toString 返回数据类型
js
typeOf("hello"); // stringtypeOf("hello"); // stringisObject 
是否为对象
js
const obj = { name: "王花花" };
isObject(obj); // trueconst obj = { name: "王花花" };
isObject(obj); // trueisArray 
是否为数组
js
const arr = ["1", "2", "3"];
isObject(arr); // trueconst arr = ["1", "2", "3"];
isObject(arr); // trueisString 
是否为字符串
js
isString("hello"); // trueisString("hello"); // trueisNumber 
是否为数字
js
isNumber(1); // trueisNumber(1); // trueisJson 
是否为 JSON
js
const jsonData = "{ name: '王花花' }";
isJson(jsonData); // trueconst jsonData = "{ name: '王花花' }";
isJson(jsonData); // trueisEmptyObject 
是否为空对象
js
const obj = {};
isEmptyObject(obj); // trueconst obj = {};
isEmptyObject(obj); // trueisEmptyArray 
是否为空数组
js
const arr = [];
isEmptyArray(arr); // trueconst arr = [];
isEmptyArray(arr); // true
LinQiang·Shen