function randomize(array) {
  let n = array.length;

  while (n) {
    n -= 1;
    const i = Math.floor(Math.random() * (n + 1));
    const temp = array[i];
    array[i] = array[n];
    array[n] = temp;
  }

  return array;
}
Fisher-Yates shuffle.
http://stackoverflow.com/a/962890/373422
https://bost.ocks.org/mike/shuffle/
@param {Array} array Array to shuffle.
@return {Array} Randomly sorted array.