title: TypeScript accessing dictionary type object
body: <p>I need a sort of dictionary in my class (I'm not sure has this kind of object is called), I'm using this:</p>
  
  <blockquote>
    <p>inputCollection: { [name: string]: HTMLInputElement };</p>
  </blockquote>
  
  <p>I can get and set values like so:</p>
  
  <blockquote>
    <p>this.inputCollection['inputId'] =
    document.getElementById('inputId');</p>
  </blockquote>
  
  <p>I would like to access my dictionary in the following manner, to get the first element</p>
  
  <blockquote>
    <p>this.inputCollection[0]</p>
  </blockquote>
  
  <p>How could I achieve this easily ?</p>