常用数据类型判断。
typeof('123') == 'string' //true
typeof(123) == 'number' //true
let arr = [];
arr instanceof Array; //true
let arr = [1,3,4];
arr.constructor === Array; //true
let arr = [1,2,3]
Object.prototype.toString.call(arr) === '[object Array]'; //true
let arr = [1,2,3]
Array.isArray(arr); //true
let o = {}
typeof(o) == 'object'; //true;
let o = {}
o instanceof Object //true
var o = {};
o.constructor == Object //true
let o = {};
Object.prototype.toString.call(o) === '[object Object]'; // true