Hello all!
So I’ve written a function for the Missing Letters alg:
function fearNotLetter(str) {
var myArray = [];
for (var i = 0; i<str.length; i++) {
myArray.push(str.charCodeAt(i));
}
for (var j = 0; j<myArray.length; j++) {
if (myArray[j + 1] !== (myArray[j] + 1)){
return String.fromCharCode(myArray[j] + 1);
}
}
}
fearNotLetter("abce");
my problem is, the program does exactly what it’s supposed to, however, the website also asks that you add an instance for when there are not any missing letters in the sequence. I have tried to add if else and else statments along with just adding return undefined;
at the end of my code and every time I add one, the undefined will return, and the actual function to find the missing letter no longer works. Please help