See JavaScript's toISOString and Intl API for the reasoning:
constdate=newDate()date.setHours('nope')//=> NaNdate.getYear()//=> NaNdate.toString()//=> Invalid datedate.toISOString()//=> RangeError: Invalid time valuenewIntl.DateTimeFormat('en-US').format(date)//=> RangeError: Invalid time value
The text was updated successfully, but these errors were encountered:
See JavaScript's
toISOString
and Intl API for the reasoning:The text was updated successfully, but these errors were encountered: