Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save moriarty99779/1c1f5a74a6a1843e14e27628a045a361 to your computer and use it in GitHub Desktop.
Save moriarty99779/1c1f5a74a6a1843e14e27628a045a361 to your computer and use it in GitHub Desktop.
Javascript - Randomize the characters in a string
const randomizeString = (str) => str.split('').sort(() => 0.5 - Math.random()).join('');
document.write(randomizeString("Every good boy deserves fudge!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment