Skip to content

Instantly share code, notes, and snippets.

@IKatsuba
Created April 9, 2021 09:14
Show Gist options
  • Save IKatsuba/980b37192154a4f04a79b0b07f0bcfa2 to your computer and use it in GitHub Desktop.
Save IKatsuba/980b37192154a4f04a79b0b07f0bcfa2 to your computer and use it in GitHub Desktop.
const items = [1, 2, 3, 4];
//before
items.sort(() => Math.random() - 0.5);
//after
items.shuffle();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment