Is Javascript equal to iconic referenced objects or clones of them?

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?

+2
source share
1 answer

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.

+7
source

All Articles