Skip to content

Instantly share code, notes, and snippets.

@mrcreel
Created October 15, 2017 20:39
Show Gist options
  • Save mrcreel/851c3bc09fee40657effd6825b192607 to your computer and use it in GitHub Desktop.
Save mrcreel/851c3bc09fee40657effd6825b192607 to your computer and use it in GitHub Desktop.
FCC_10-08 Missing letters
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