Tell us what’s happening:
Hey guys! Cant figure out why this isn’t working. Any ideas? The function works, but doesn’t returned undefined.
Your code so far
function fearNotLetter(str) {
for (var i = 0; i < str.length; i++){
if (str.charCodeAt(i) !== str.charCodeAt(i + 1) - 1){
let result = String.fromCharCode(str.charCodeAt(i + 1)-1);
return result;
}
}
return undefined;
}
fearNotLetter("abce");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/missing-letters