Skip to content

Instantly share code, notes, and snippets.

@akhilome
Last active May 31, 2021 13:13
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 akhilome/73b463ba7d1cca9638e532495c7bac5c to your computer and use it in GitHub Desktop.
Save akhilome/73b463ba7d1cca9638e532495c7bac5c to your computer and use it in GitHub Desktop.
// ABC...Z
const alphaUpper = Array(26)
.fill('')
.map((_, i) => String.fromCharCode(65 + i))
.join('');
// abc...z
const alphaUpper = Array(26)
.fill('')
.map((_, i) => String.fromCharCode(65 + i))
.join('');
// 012...9
const num = Array(10)
.fill('')
.map((_, i) => String.fromCharCode(48 + i))
.join('');
// CharCodes
// 65 -> A, 90 -> Z
// 97 -> a, 122 -> z
// 48 -> 0, 57 -> 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment