[常用函数]判断数据类型
获取类型
// 获取数据类型 export const getType = (o: any) => Object.prototype.toString.call(o).slice(8, -1); export const isObject = (o: any) => getType(o) === 'Object'; export const isArray = (o: any) => getType(o) === 'Array'; // 不是undefined和null export const isDefined = (o: any) => o !== undefined && o !== null;