DEV Community

Discussion on: Some Things About JSON That You May Have Missed

Collapse
 
sams4s profile image
sam-s4s

Also if the object or class that you're converting has a toJSON function, it will use that to determine the output - can be very handy :)

developer.mozilla.org/en-US/docs/W...

Collapse
 
aumayeung profile image
John Au-Yeung

Yea. Then we don't have to passing a mapping function every time we want to stringify. I think URL and URLSearchParams objects have this method.