title: Complexity of accessing data in an object
body: <p>In some of the projects I'm working on as part of my day job, I need to access data in very large JS objects (on the order of thousands of key-value pairs). I'm trying to improve the efficiency of my code, so I came up with a few questions: </p>
  
  <ol>
  <li>What is the runtime complexity of JS when accessing a field in such an object? <em>My initial hunch is that it's O(n)</em></li>
  <li>Is there a difference when accessing through dot notation or bracket notation? (e.g. <code>obj.field</code> vs <code>obj[field]</code>)</li>
  <li>I'm guessing there is a different answer for different runtime engines - is there a place where I can see the difference between them?</li>
  </ol>