需要预习:call , typeof, js数据类型 1. isFunction中typeof的不靠谱 源码: var isFunction = function isFunction( obj ) { // Support: Chrome <=57, Firefox <=52 // In some browsers, typeof returns "function" for HTML <object> elements // (i.e., `typeof d
最常用的判断方法:typeof var a='isString'; var b=121221; var c=[1,2,3]; var d=new Date(); var e=function(){ console.log('12'); }; var f=function(){ this.name='22'; }; var g=null; var h=undefined; var i=true; console.log(typeof b) =======> number console.log(t
/** * Returns true if the passed value is empty, false otherwise. The value is deemed to be empty if it is either: * * - `null` * - `undefined` * - a zero-length array * - a zero-length string (Unless the `allowEmptyString` parameter is set to `true`