Skip to content

Instantly share code, notes, and snippets.

@himynameisdave
Last active April 28, 2016 02:49
Show Gist options
  • Select an option

  • Save himynameisdave/18b33fe4d416d0bd1e7d6ca2bc5716cf to your computer and use it in GitHub Desktop.

Select an option

Save himynameisdave/18b33fe4d416d0bd1e7d6ca2bc5716cf to your computer and use it in GitHub Desktop.
A shuffle one-liner
export default shuffle = (arr) => arr.sort((a, b) => arr.map(Math.random)[a] - arr.map(Math.random)[b]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment