[jQuery] Re: Creating a copy of associative array

2009-02-10 Thread Dave Methvin
> You can use jQuery's extend() to do it for you: That's the way to go. You can do a deep copy this way: var mycopy = $.extend(true, {}, myoriginal); However, if the original object has any special objects in it such as Date they will just be copied by reference. Don't extend Object.prototype

[jQuery] Re: Creating a copy of associative array

2009-02-10 Thread James
You can use jQuery's extend() to do it for you: test = {'foo':{'bar':'orig message'}}; var test2 = {} $.extend({}, test2, test); There's probably a simpler way. I'd also be interested to know. :) On Feb 10, 6:03 am, twooton wrote: > I cant figure out how to create a unique copy of an associat