method Date.toJSON Private Date.toJSON(key?: any): string Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. Parameters optional key: any Return Type string