I researched about converting date into string in ISO format, and I found two methods to do that giving me the same result '2022-07-29T06:46:54.085Z':
(new Date()).toISOString()JSON.parse(JSON.stringify(new Date()))
Question:
- Does
JSmake two approaches/algorithms of converting date or just one function code just call on different objectJSONorDate, If So Which one is the best to use?