Convert Date to ISO String
ISO 8601 Date Strings
A widely used standard for datetime representation is ISO 8601. ISO 8601 date strings come in several different formats, but the most common and recognized format is something like this:
In this lab, you'll create a function
convertToISOString that accepts a Date object as a parameter and returns its ISO 8601 string representation. The function should handle error cases for undefined input or input that is not a Date object.