The Platform now ships with structuredClone() , a built-in function for deep-copying. Changes to deeply nested values will be visible in the copy as well as the original. A deep copy copies an object’s properties one by one, but invokes itself recursively when it finds a reference to another object.

5m read timeFrom web.dev
Post cover image
Table of contents
Shallow copies #Deep copies #Structured cloning #Conclusion #
1 Comment

Sort: