JSON module imports are now baseline across browsers, but they have important behavioral differences from fetch(). Module imports cache data for the page lifetime and can cause memory leaks with dynamic data or large objects, while fetch() allows garbage collection. Error handling with fetch() also provides better introspection

3m read timeFrom jakearchibald.com
Post cover image
Table of contents
Error handlingCaching and garbage collectionWhen should JSON modules be used?

Sort: