Created
October 15, 2017 20:39
-
-
Save mrcreel/851c3bc09fee40657effd6825b192607 to your computer and use it in GitHub Desktop.
FCC_10-08 Missing letters
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 fearNotLetter(str) { | |
var numFirstChar = str.charCodeAt(0); | |
var numLastChar = str.charCodeAt(str.length - 1); | |
var j = 0; | |
var res; | |
for (var i = numFirstChar; i <= numLastChar; i++) { | |
if (i != str.charCodeAt(j)) { | |
res = String.fromCharCode(i); | |
break; | |
} | |
j++; | |
} | |
console.log(res); | |
return res; | |
} | |
fearNotLetter("bcd"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment