I have the following object:
var obj1 = {};
obj1.obj2 = {
prop1: 0
};
and the following function:
function func1() {
var p = obj1.obj2.prop1;
p += 2;
return p;
};
When updating 'p' it has not updated 'obj1.obj2.prop1'. Instead of 'p' pointing to the original object is it now it's own object by itself? If so how can I make 'p' a pointer?