Skip to main content

isDate

function isDate
Jump to headingisDate(object: unknown): object is Date
Deprecated

Returns true if the given object is a Date. Otherwise, returns false.

import util from 'node:util';

util.isDate(new Date());
// Returns: true
util.isDate(Date());
// false (without 'new' returns a String)
util.isDate({});
// Returns: false

Parameters Jump to heading

Jump to headingobject: unknown

Return Type Jump to heading

object is Date
Back to top