title: Check inside a loop that array has next element in Javascript/QML
body: <p>I have an array <code>items</code>. I need to make sure that in the current iteration of the loop I can safely call the next item of the array</p>
  
  <pre><code>for(var i = 0; i &lt; items.length; ++i) {
  
    // do some stuff with current index e.g....
    item = items[i];
  
  
     // then do something with item @ i+1
     if(items[i+1]) {
        //do stuff 
     }
  
  }
  </code></pre>
  
  <p>Is this how it is done or if not how/what would be the better way?</p>
  
  <p>P.S. I do not want to do a bound check </p>