JavaScript 检查数据类型
Object.prototype.toString.call(data)
[object Object]
[object Array]
[object FormData]
[object Function]
typeof 'a'; // string
typeof 2; // number
typeof []; // object
typeof {}; // object
typeof (()=>{}); // function
网友评论