The toISOString() method returns a string that represents the given date in the ISO 8601 format according to universal time.
The toISOString() method returns a string in extended ISO format (ISO 8601). The timezone is zero UTC offset as indicated by the suffix "Z". It does not take any parameter and only used along with a Date object.
Date Object
JavaScript Date object represents a single instance in time in a platform-independent format. It contains a number that represents milliseconds since January 1, 1970, UTC. There are a number of methods that obtain a date in various formats, as well as to perform time zone conversions. There are also functions that output the date and time in UTC (Coordinated Universal Time), the global standard time defined by the World Time Standard.