/**
* 判断变量类型
* */
var valueType = {
isString : function(value){
return value.constructor.name == 'String';
},
isInt : function(value){
if (value.constructor.name == 'Number' || value.constructor.name == 'String'){
return /(^[0-9]+$)/.test(value);
}else{
return false;
}
},
isfloat : function(value){
if (value.constructor.name == 'Number' || value.constructor.name == 'String'){
return /(^[0-9]+\.?[0-9]+$)/.test(value);
}else{
return false;
}
},
isNumber : function(value){
if (value.constructor.name == 'Number'){
return true;
}else{
return /(^[0-9]+\.?[0-9]+$)|(^[0-9]+$)/.test(value);
}
},
isBoolean : function(value){
return value.constructor.name == 'Boolean';
},
isObject : function(value){
return value.constructor.name == 'Object';
},
isArray : function(value){
return value.constructor.name == 'Array';
},
isFunction : function(value){
return value.constructor.name == 'Function';
},
isUndefined : function(value){
return value == undefined;
},
isNull : function(value){
return value == null;
}
}