isDate es-toolkit
Checks if a value is a Date object.
Usage
isDate(value)
Use isDate when you want to check if a value is a date object. Useful for distinguishing Date objects from string or number representations of dates. It acts as a type guard in TypeScript, narrowing the value's type to Date.
Particularly useful when used as a type guard in TypeScript.
Can be used for processing API responses or validating user input.
Parameters
valueunknownrequired
The value to check if it's a Date object.
Returns
Returns true if the value is a Date object, false otherwise.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.