5.33 isDate

5.33.1 语法

_.isDate(object)

5.33.2 说明

如果object是日期对象,返回true。

5.33.3 代码示例

_.isDate(new Date()); //=> true

5.33.4 其他写法

function isDate(obj){
    return toString.call(obj) === '[object Date]';
}

isDate(new Date()); //=> ture