isArray,isEmptyObject,isFunction等方法实现
function isArray(arr){return Object.prototype.toString.call(arr) === "[object Array]";} 例如: isArray(new Array('a','d'));为true
?
function isFunction(arr){return Object.prototype.toString.call(arr) === "[object Function]";} 例如: var a= function(){} isFunction(a),true
?
function isFunction(arr){return Object.prototype.toString.call(arr) === "[object Object]";}
?
?
function isEmptyObject(o){ for(var a in o) return false; return true;}
?