Skip to content

Instantly share code, notes, and snippets.

@frenata
Last active February 28, 2017 05:50
Show Gist options
  • Save frenata/229b15c89691b0d747e8dfc4f6a9affa to your computer and use it in GitHub Desktop.
Save frenata/229b15c89691b0d747e8dfc4f6a9affa to your computer and use it in GitHub Desktop.
function alphabet() {
let letter =
arguments.length > 0 ?
arguments[0] :
"a";
let next = String.fromCharCode(letter.charCodeAt(0)+1);
return next == "z" ?
next :
letter + alphabet(next);
}
console.log(alphabet());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment