When I store an object as {a: 1, b: 2 } in jQuery data, does it copy the object or keep a reference to it?
I have a huge object, and I want different elements to keep different links from different points to the same object, and I do not want it to be copied.
how
var obj = { a: { one: 1, two: 2 }, b: { apple: 'yummy', banana: 'ehh' } c: { d: { 'jQuery': jQuery } e: ['You get the point'] } }; $('div').data('info', obj.b); $('#JQ').data('jq_reference', obj.cdjQuery);
javascript jquery object
qwertymk
source share