I’d hope to find an example code to do a deep copying of objects in ECMAScript5.
The copying should be able to clone
-
Nested objects
-
Nested arrays
-
Nested objects in arrays (clone each array item individually)
Note: jQuery.extend() does not seem to handle case 3). Also, I’d hope to do this in clean ECMAScript. Quick googling did not bring up any worthy implementations.
I finally settled to
jQuery.extend()as I couldn’t find other good implementationshttp://api.jquery.com/jQuery.extend/