title: assign object as key value in javascript
body: <p>I am tyring to do something like this:</p>
  
  <pre><code>this.slides = {$('#Page_1') : null,
                 $('#Page_2') : null,
                 $('#Page_3') : null};
  </code></pre>
  
  <p><strong>Why am I doing this, or what advantage do I gain?</strong><br>
  I dont want to use jquery selectors throughout class.</p>
  
  <hr>
  
  <h2>A Solution:</h2>
  
  <pre><code>this.slides = [{"key": $('#Page_1'), "value": null},
                 {"key": $('#Page_2'), "value": null},
                 {"key": $('#Page_3'), "value": null}];
  </code></pre>
  
  <p><strong>Limitation:</strong> </p>
  
  <blockquote>
    <p>The problem with this approach is that you have to iterate through the
    whole object each time you want to approach this. You should use the
    id as identifier, this is much more efficient. – Christoph </p>
  </blockquote>