Last active
February 28, 2017 05:50
-
-
Save frenata/229b15c89691b0d747e8dfc4f6a9affa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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