/*判断对象是否为数组类型*/
isArray: function(obj){
return Object.prototype.toString.call(obj) === '[object Array]';
},
isString: function(obj){
return Object.prototype.toString.call(obj) === '[object String]';
},
isNumber: function (obj) {
return Object.prototype.toString.call(obj) === '[object Number]';
},
isObject: function(obj){
return Object.prototype.toString.call(obj) === '[object Object]';
},
isDate: function(obj){
return Object.prototype.toString.call(obj) === '[object Date]';
},
isFunction: function(obj){
return Object.prototype.toString.call(obj) === '[object Function]';
},
网友评论