title: JS while loop array[i++]. How does it work?
body: <p>I'm wondering how it works. I guess that "right[r++]" increments "r" in while loop. Or it shows which element of "right" we push to "result"?</p>
  
  <pre><code>function merge(left, right){
    var result = [],
        lLen = left.length,
        rLen = right.length,
        l = 0,
        r = 0;
    while(l &lt; lLen &amp;&amp; r &lt; rLen){
       if(left[l] &lt; right[r]){
         result.push(left[l++]);
       }
       else{
         result.push(right[r++]);
      }
    }  
    return result.concat(left.slice(l)).concat(right.slice(r));
  }
  </code></pre>
  
  <p>Thank you.</p>