title: Insertion - what's wrong with my code or is it just a website bug?
body: <p>It's from Khan Academy challenge: implement <code>insert</code>. I can't seem to move on even though the results are correct.</p>
  
  <pre><code>var insert = function(array, rightIndex, value) {
      var key=value;
      for(var i=rightIndex; key&lt;array[i]&amp;&amp;i&gt;=0; i--)
      {
          array[i+1]=array[i];
  
      }   
      array[i+1]=key;
  
  
  };
  
  var array = [3, 5, 7, 11, 13, 2, 9, 6];
  
  insert(array, 4, 2);
  println("Array after inserting 2:  " + array);
  Program.assertEqual(array, [2, 3, 5, 7, 11, 13, 9, 6]);
  
  insert(array, 5, 9);
  println("Array after inserting 9:  " + array);
  Program.assertEqual(array, [2, 3, 5, 7, 9, 11, 13, 6]);
  
  insert(array, 6, 6);
  println("Array after inserting 6:  " + array);
  Program.assertEqual(array, [2, 3, 5, 6, 7, 9, 11, 13]);
  </code></pre>