code: function reverseInplace(array) {
    for (var i = 0; i < array.length / 2; ++i) {
      var h = array[i];
      var ii = array.length - i - 1;
      array[i] = array[ii];
      array[ii] = h;
    }
  }
docs: Reverses the given array in place.