function shuffle(array) {
  const { length } = array;
  for (let index = 0; index < length; index++) {
    const newIndex = Math.floor(Math.random() * length);
    swap(array, index, newIndex);
  }
  return array;
}
Shuffle items in an array in-place
Runtime: O(n)
@param {*} array