Created
June 23, 2023 17:51
-
-
Save samchouse/e1ab321154af1183607ccfb7992f8703 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 scramble = (content: string) => { | |
| return content.split(" ").map((word) => | |
| word.slice(0, 1) + | |
| word.slice(1, word.length - 1).split("").sort(() => Math.random() - 0.5) | |
| .join("") + | |
| word.slice(word.length - 1) | |
| ).join(" "); | |
| }; | |
| console.log(scramble(Deno.args[0] ?? "")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment