function judgeType(value) { if (value == null) { return value + ""; } let str = (typeof value === "object" || typeof value === "function" ? Object.prototype.toString.call(value) : typeof value) str = str.replace(/(\[object )|\]/g, '').toLowerCase() return str } function isFunction(value) { return judgeType(value) === 'function' } function isDate(date) { return judgeType(date) === 'date' }