Skip to content

Instantly share code, notes, and snippets.

@Keldrik
Created August 16, 2019 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Keldrik/abc2ef03f1b373fc4357147abdb16ae5 to your computer and use it in GitHub Desktop.
Save Keldrik/abc2ef03f1b373fc4357147abdb16ae5 to your computer and use it in GitHub Desktop.
Helper module for creating random strings with letters and numbers.
const randomString = (length) => {
return [...Array(length)].map(() => Math.random().toString(36)[2]).join('');
}
export default randomString;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment