When I store an object like {a: 1, b: 2 } in jQuery's data, does it copy the object or save a reference to it?
I have a huge object and I want different elements to store different references from different points to the same object, and I don't want it to get copied.
Like
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.c.d.jQuery);