title: How to check if an array index exist?
body: <p>I'm trying to check whether an array index exist in TypeScript, by the following way (Just for example):</p>
  
  <pre><code>var someArray = [];
  
  // Fill the array with data
  
  if ("index" in someArray) {
     // Do something
  }
  </code></pre>
  
  <p>However, i'm getting the following compilation error:</p>
  
  <blockquote>
    <p>The in operator requires the left operand to be of type Any or the
    String primitive type, and the right operand to be of type Any or an
    object type</p>
  </blockquote>
  
  <p>Anybody knows why is that? as far as I know, what I'm trying to do is completely legal by JS.</p>
  
  <p>Thanks.</p>