JS Built-ins
← Date97 / 120
DatetoISOStringbeginner

toISOString() β€” contains "T" separator

πŸ“– Usage Example
const d = new Date('2024-01-15T00:00:00.000Z')
d.toISOString()  // β†’ '2024-01-15T00:00:00.000Z'

Use toISOString() to serialize a Date as a UTC ISO 8601 string in the format YYYY-MM-DDTHH:mm:ss.sssZ.

Date.prototype.toISOString()

ISO 8601 strings use "T" to separate the date portion from the time portion.

Challenge: Verify that the output of toISOString() includes 'T'.

πŸ’‘ Hints (1)
  • β€’ The "T" separator is part of the ISO 8601 standard format