What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-15 11:48:23
js deep copy array
var sheep=[ {"height":20,"name":"Melvin"}, {"height":18,"name":"Betsy"} ]; var clonedSheep=JSON.parse(JSON.stringify(sheep)); //clone array of objects //note: cloning like this will not work... Add solution -
Javascript 2021-09-23 14:27:03
how to deap clone an object in javascript
var sheep={"height":20,"name":"Melvin"}; var clonedSheep=JSON.parse(JSON.stringify(sheep)); //note: cloning like this will not work with some complex objects such as: Date(), undefined, Infinity // For complex objects t... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5