Skip to main content

structuredClone Replaces JSON Hacks

structuredClone(value) performs a deep clone of complex objects — including Map, Set, Date, RegExp, and circular references — without going through JSON.This eliminates the JSON.pa…

April 25, 2026 JavaScript chris 1 min read Tooling

Article takeaway

structuredClone(value) performs a deep clone of complex objects — including Map, Set, Date, RegExp, and circular references — without going through JSON.This eliminates the JSON.pa…

structuredClone(value) performs a deep clone of complex objects — including Map, Set, Date, RegExp, and circular references — without going through JSON.

This eliminates the JSON.parse(JSON.stringify(x)) idiom that quietly dropped Dates, undefined, and Map entries. It is also faster on Chrome and Node for large objects.

Browser support is everywhere except some embedded browsers; Node 17+ has it natively. The transfer option even lets you hand off ArrayBuffers to a worker.

Share X / Twitter LinkedIn

Leave a comment

Related Posts