I was wondering if someone could shine a little light on the following subject.
I have "heavy" object with lots of functions and properties:
var HeavyObject = {
property1:{}
property2:1,
propertyN:false,
func1:function(){}
func2:function(){}
....
funcN:function(){}
}
Next I have a "lightweight" object:
var LightWheight = {
property1: {
sub_property:HeavyObject
},
property2: {
sub: {
sub:{
flag:true,
heavy:HeavyObject
}
}
}
}
My question is how heavy my "LightWeight" object actually is since it has two references to the "HeavyObject"? Does it only keep two pointers to the "HeavyObject" or is the reference done differently?
I understand that this might vary based on the JavaScript engine, but I would like to understand the general idea.
Any clarification is greatly appreciated.