27 lines
418 B
JavaScript
27 lines
418 B
JavaScript
Object.isNullOrUndefined = function(value) {
|
|
if (typeof (value) == "undefined") {
|
|
return true;
|
|
}
|
|
|
|
if (value == null) {
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
};
|
|
|
|
Object.getDataType = function(value) {
|
|
if (String.isNullOrUndefined(value)) {
|
|
return "null";
|
|
}
|
|
|
|
if (typeof(value) == "object") {
|
|
if (Array.isArray(value)) {
|
|
return "array";
|
|
} else {
|
|
return "object";
|
|
}
|
|
}
|
|
|
|
return typeof(value);
|
|
}; |