Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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

Assuming that you have only properties and not any functions in your object, you can just use:

var newObject = JSON.parse(JSON.stringify(oldObject));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #What #efficient #deep #clone #object
ADD COMMENT
Topic
Name
2+9 =