In MyApp.something.BigObject I have an expensive memory object, and I like to do it var theObject = MyApp.something.BigObject; . My question is, will it take twice as much memory or not?
MyApp.something.BigObject
var theObject = MyApp.something.BigObject;
An equal sign is an assignment operator. If RHS is an object, then the link is assigned by LHS, it does not clone or copy the object.
So, given:
var obj = {}; var b = obj;
both objects obj and b refer to the same object.