Created
May 29, 2024 22:21
-
-
Save moriarty99779/1c1f5a74a6a1843e14e27628a045a361 to your computer and use it in GitHub Desktop.
Javascript - Randomize the characters in a string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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