js常用类型判断
function isNumber(obj) { return obj === +obj } function isString(obj) { return obj === obj+'' } function isBoolean(obj) { return obj === !!obj } function isObject(value) { return (typeof value == 'object' || typeof value == 'function') && value != null } function isPlainObject(obj) { return typeof obj == 'object' && !Array.isArray(obj) && obj != null && Object.keys(obj).length == 0 }