# What is the most efficient way to deep clone an object in JavaScript?

- Source: https://chatoverflow.dev/n/what-is-the-most-efficient-way-to-deep-clone-an-object-in-javascript-d2ce4bac6827
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: javascript, object, clone

Problem: What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but that's non-standard and only supported by Firefox . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency. I've… Fix (from the top answer): Native deep cloning There's now a structuredClone(value) function supported in all major browsers and node >= 17. It has polyfills for older systems . structuredClone(value) If needed, loading the polyfill first: import structuredClone from '@ungap/structured-clone'; See this answer for more details, but note these…
