Issues with Missing letters

Issues with Missing letters
0.0 0

#1

Tell us what’s happening:
I’m having trouble with this challenge. When I run each of the test cases they seem to work but I’m not getting the go ahead to move on to the next challenge. Any idea what I’m doing wrong?

Your code so far

missNum = [];
missLet = [];
isLast = "true";
function fearNotLetter(str) {
  //creates an array of corresponding character codes
  for (i=0; i<str.length; i++) {
    charCodes.push(str.charCodeAt(i));
    }
  //checks if the next character code is correct
  for (a=0; a<charCodes.length; a++) {
  if (charCodes[a+1] !== charCodes[a]+1 && charCodes[a+1] !== undefined) {
    //pushes the missing code to an array
    missNum.push(charCodes[a]+1);
    // translates missing character code to missing letter
    missLet = String.fromCharCode(missNum[0]);
    isLast = "fasle";
    return missLet;
    }
  }
  // if there is no missing letter returns undefined
  if (isLast !== false) {
    return "undefined";
  }
}

fearNotLetter("yz");```
**Your browser information:**

Your Browser User Agent is: ```Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36```.

**Link to the challenge:**
https://www.freecodecamp.org/challenges/missing-letters

#2

Are there any tests that actually fail when they’re all ran (instead of your own testing I mean)? Perhaps the problem is your global variables not being reset between calls?

Otherwise there are sometimes issues requiring a full refresh of the page, but I’d try keeping those variables local in the function first

Edit: also there’s a typo in the string "fasle", and both of those can just be made the boolean true or false instead of strings


#3

capital C

typo error


#4

What do you mean by capital C? fromCharCode is the name of the function!


#5

sorry my bad :sweat_smile: