Skip to content

Instantly share code, notes, and snippets.

@execmd
Created June 17, 2015 09:20
Show Gist options
  • Select an option

  • Save execmd/906c1bb34a7e452e3cda to your computer and use it in GitHub Desktop.

Select an option

Save execmd/906c1bb34a7e452e3cda to your computer and use it in GitHub Desktop.
Generate string from char code ranges
var string = '';
var chars = [[48, 57], [65, 90], [97, 122]];
chars.forEach(function (charRange) {
for (var i = charRange[0]; i<=charRange[1]; i++) {
string += String.fromCharCode(i);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment