Answers for "typescript if typeof date"

0

typescript how to check if string is a date

var isDate = function(date) {
    return (new Date(date) !== "Invalid Date") && !isNaN(new Date(date));
}
Posted by: Guest on May-31-2021
-1

typeof date

// use instanceof to determine the "type of" Date object
if (dateObj instanceof Date) {}
Posted by: Guest on January-19-2022

Code answers related to "TypeScript"

Browse Popular Code Answers by Language