`Hey does anyone think this solution is too complicated?
The concept is that if the letters are in sequence?The utf value should also be in sequence from low to high.
Subtracting the utf-16 value of each letter in front should leave over 1 if the letters are in sequence.
Otherwise failing this test will identify the utf value of the letter that is missing.
function fearNotLetter(str) {
var first=str.charCodeAt(0); //should equal lets say 65
var string_length = str.length;
var first_element = str.charCodeAt(0);
var missing_letter;
var missing_letter_string;
for(var i=1;i<string_length;i++){
if(str.charCodeAt(i)-first_element!==1){
console.log(str.charCodeAt(i),first_element);
missing_letter = str.charCodeAt(i)-1;
missing_letter_string = String.fromCharCode(missing_letter);
break;
}
else
first_element++;
}
return missing_letter_string;
}
fearNotLetter("abce");