function swap(ary, x, y) {
  var temp = ary[x];
  ary[x] = ary[y];
  ary[y] = temp;
}
Swap the elements indexed by `x` and `y` in the array `ary`.

@param {Array} ary
       The array.
@param {Number} x
       The index of the first item.
@param {Number} y
       The index of the second item.