Technically there are no such things as an Associative Array in Javascript. But for reasons I can't avoid, I've ended up having t do things such as
var x = [1,2,3];
x.someRequiredProperty = 'some value';
As expected, Javascript being Javascript, it works. But now, how do I make a copy of this 'array' so that I can work on multiple instances of this array without compromising the original?
I've tried jQuery $.extend([], x)
, which doesn't really give me a new copy. Is there something I'm missing?