Checks if the given value is a Date object.

Type signature

(x?: any) => boolean

Examples

date(new Date());
// ⇒ true
Try in REPL
date(123);
// ⇒ false
Try in REPL

Questions

  • How to check if a given value is a Date object?

TypeScript sourceJavaScript source