title: Access object by name in array list
body: <p>I have an object that contains an array list of objects. I'd like to get the value of an object within the array list. </p>
  
  <p>example</p>
  
  <pre><code>var data = { 
               items1: [{ id: 1, name: 'foo' }, { id: 2, name: 'bar' }], 
               items2: [{ id: 3, name: 'foo' }, { id: 4, name: 'bar' }] 
             };
  </code></pre>
  
  <p>I'm trying to access the name of id:1 in array list items1. </p>
  
  <p>I thought it would be something like </p>
  
  <pre><code>data['items1']['id'].name 
  </code></pre>
  
  <p>but I think I'm missing something. Anybody know what I might be doing wrong</p>