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
Best helpers
Dodo mugs
+5
Lee lee
+5
Ulrich Stern
+5
S.Exchange
+5
Marc-Olivier
+5
Fcpenha
+5
Sisima70
+5
Superam
+5
KidKai
+5
Yoyoyo
+5