To clarify my question,
I have a large chunk of code which accesses properties of JS objects which at some times is nested inside multiple other objects i.e,
object.array1[0].anotherObject.finalObject.someProperty
This property is referenced multiple times during execution. Assuming there are no concurrency problems, is it more efficient to assign this property to a variable to test values against it this way,
var prop = object.array1[0].anotherObject.finalObject.someProperty
The question boils down to me being unfamiliar with how referencing works in JS. Is there a point where the overhead for creating and assigning a variable is more efficient than accessing an object's property multiple times. If so, is there a good rule of thumb to follow when deciding which to use?