isDate()function
isDate(value: unknown): value is Date
| Param | Type | |
|---|---|---|
value | unknown | The value to check. required |
| Return | |
|---|---|
value is Date | true if the value is a Date instance representing a valid date, narrowing it to Date. |
Is a value a valid Date instance?
- Note:
Dateinstances can be invalid (e.g.new Date("blah blah").getTime()returnsNaN). These are detected and will always returnfalse