DEV Community

Discussion on: Two string methods every JavaScript developer should know.

Collapse
 
_hoyet profile image
Jeremiah Hoyet

They would have still needed to use string.replace to remove the double quotes around the date string, but I prefer your approach of using the Date APIs to ensure you're always going to get the same result.

Collapse
 
p12y profile image
Peter Tyldesley

Not necessarily, you could do it with String.slice or JSON.parse instead.