I'm doing some testing on jQuery.data()
, and I'm trying to create a local reference to a certain data-key, which I hopefully can change locally and still affect "outside". I think it would be better with an example, due to the semi-long code I posted it on jsFiddle instead of here:
http://jsfiddle.net/esbenp/p4kt2/22/
the output I hope for is:
{1: {length: 1}, total: 1}
but only the length property is affected by incrementing the local variable:
{1: {length: 1}, total: 0}
what should I do?