Date.toJSON
toJSON – Converts a Date object to a string.
Description
Date.toJSON()
JSON does not have a understanding of a date representation. The format of toJSON is compact, human readable, and is understood by most programming languages.
Return values
string primitive.
Examples
Example #1 – toJSON example