I am building a number of HTML5 games and I am not sure about one thing in javascript.
When dealing with a large object (with a lot of attributes and methods), is it somehow different, if I store the attribute value in a variable?
Say I have to check for some value in application.data.setings.foo.bar
multiple times per second. Should I store it in a variable fooBar
? If I understand it correctly, the variable would be just a reference, so it shouldn't matter.
so: Should you store values of large objects' attributes in variables?