title: Create an array of Objects with custom keys
body: <p>Currently, I have an array of objects, that looks like this:</p>
  
  <pre><code>var arr = [{
              id: UNIQUE_ID,
              title: 'TITLE'
            }, {
              id: UNIQUE_ID,
              title: 'TITLE'  
            }];
  </code></pre>
  
  <p>What is bothering me here, is that in particular cases I have to loop through the array and display data for matching ID. I want to just fetch everything for that particular object, thas has the ID I want, and that's it. It would be a lot easier for me if the array looked more like this:</p>
  
  <pre><code>var arr = [{
              id: {
                title: 'TITLE'
              },
              id: {
                title: 'TITLE'
              }
            }]
  </code></pre>
  
  <p>The ID comes from a result of a method that generates a random number, so I'll need to put a variable or a method call for this id.</p>
  
  <p>I'm not sure this is possible, since I found no particular example on this, but I'd like to hear another solutions as well.</p>