Created
May 10, 2021 14:32
-
-
Save RahmatSaeedi/3196321ea338bfc0a2d70e3005600c23 to your computer and use it in GitHub Desktop.
CodeSignal - Arcade - Intro - JS - alphabeticShift
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
function alphabeticShift(inputString) { | |
return inputString.split("").map( c => { | |
if(c == 'z') | |
c = 'a'; | |
else | |
c = String.fromCharCode(c.charCodeAt(0) + 1); | |
return c; | |
}).join(""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment