Last active
February 3, 2021 21:31
-
-
Save pwener/bf52da31fdbe6aef5d98d11d7bff0b4f to your computer and use it in GitHub Desktop.
Random string with lenght n (Typescript/Javascript)
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
| function randomString(range: number) { | |
| let str = ''; | |
| for(let index=0; index <= range; index++) { | |
| str += Math.random().toString(36).replace(/\./g,''); | |
| } | |
| return str; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment