Possible Duplicate:
What is the most efficient way to clone a JavaScript object?

I need to copy an (ordered, not associative) array of objects. I’m using jQuery. I initially tried

jquery.extend({}, myArray)

but, naturally, this gives me back an object, where I need an array (really love jquery.extend, by the way).

So, what’s the best way to copy an array?

8 Answers
8

Leave a Reply

Your email address will not be published. Required fields are marked *