title: How to check if an array index exists or not in javascript?
body: <p>I am working with Titanium, my code looks like this:</p>
  <pre><code>var currentData = new Array();
  if(currentData[index]!==&quot;&quot;||currentData[index]!==null||currentData[index]!=='null')
  {
      Ti.API.info(&quot;is exists  &quot; + currentData[index]);
      return true;
  }
  else
  {   
      return false;
  }
  </code></pre>
  <p>I am passing an index to the <code>currentData</code> array. I still can't detect a non-existing index using the above code.</p>