Reputation: 6834
Is the following line considered unoptimal, especially considering it is being used in many places or inside of a loop:
var age = myObject[index]["Person"]["Identity"]["Bio"]["Age"]
Upvotes: 0
Views: 85
Reputation: 7900
Even if hash lookup in Javascript is O(1) (I don't know for sure), you'd still have the overhead of the lookup operations. So, yes, this is suboptimal for a big loop.
Upvotes: 1