Convert a date object to a string:
let text = d.toString();
toString() method returns a date object as a string.
when an object needs to be displayed as a text (like in HTML),
or when an object needs to be used as a string.
Normally, you will not use it in your own code.
toString() is an ECMAScript1 (ES1) feature.
|Date and time represented as a string|