I want to check if this is an invalid date. So when there is one, I can convert the unix into an integer. How can I do this? As far as I know new Date returns me an string when unix is passed but not the message “Invalid Date”
let date = new Date(date_str)
console.log("DATE: ", date_str, typeof date_str)
if (date === "Invalid Date") {
console.log("this is an invalid date")
}
Challenge: Timestamp Microservice
Link to the challenge: