- 判断是否为数组类型
function isArray(obj){ return (typeof obj=='object')&&obj.constructor==Array; }
- 判断是否为字符串类型
function isString(str){ return (typeof str=='string')&&str.constructor==String; }
- 判断是否为数值类型
function isNumber(obj){ return (typeof obj=='number')&&obj.constructor==Number; }
- 判断是否为日期类型
function isDate(obj){ return (typeof obj=='object')&&obj.constructor==Date; }
- 判断是否为函数
function isFunction(obj){ return (typeof obj=='function')&&obj.constructor==Function; }
- 判断是否为对象
function isObject(obj){ return (typeof obj=='object')&&obj.constructor==Object; }