Skip to content

Instantly share code, notes, and snippets.

@syropian
Last active December 20, 2015 02:29
Show Gist options
  • Save syropian/6056262 to your computer and use it in GitHub Desktop.
Save syropian/6056262 to your computer and use it in GitHub Desktop.
A neat way of creating a sequence in JavaScript, sans loop.
var alphabet = Array.apply(0, Array(26)).map(function(x,y) {
return String.fromCharCode(y + 65);
}).join('');
console.log(alphabet);
//Outputs 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment