function fearNotLetter(str) {
for(x=str.length - 1; x >= 0; x--){
if(str.charCodeAt(x) - str.charCodeAt(x-1) === 1){
return undefined;
}
else if((str.charCodeAt(x) - str.charCodeAt(x-1)) > 1){
return String.fromCharCode(str.charCodeAt(x) - 1);
}
}
}
fearNotLetter("abcdefghjklmno");
So my code is passing 3/4 of the tests. It just can’t pass the one provided (abcdefghjklmno). I feel like its something obvious, but have been banging my head against a wall, trying to find the issue.