Last active
August 29, 2015 14:10
-
-
Save thetallweeks/fce6269c23f38e1b1def to your computer and use it in GitHub Desktop.
An array of the alphabet
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
// From http://stackoverflow.com/a/12377023/1660815 | |
function range(start,stop) { | |
var result=[]; | |
for (var idx=start.charCodeAt(0),end=stop.charCodeAt(0); idx <=end; ++idx){ | |
result.push(String.fromCharCode(idx)); | |
} | |
return result; | |
}; | |
range('a', 'z'); | |
// ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"] | |
range('A', 'Z'); | |
// ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment