Build a Missing Letter Detector - Build a Missing Letter Detector

Tell us what’s happening:

i dont know whats wrong ive tried n tried i’ve given up

Your code so far

function fearNotLetter(letter) 
{
  let ans;
  let alphabet = "abcdefghijklmnopqrstuvwxyz";
  letter = letter.toLowerCase();

  for(let a = 0; a < alphabet.length; a++)
  {
      if(letter.indexOf(alphabet[a]) === -1)
       {
         ans = alphabet[a]
         break;
       }
    
  }
  return ans

}

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:155.0) Gecko/20100101 Firefox/155.0

Challenge Information:

Build a Missing Letter Detector - Build a Missing Letter Detector

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-missing-letter-detector/af7588ade1100bde429baf20.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hi @verver,

Try calling your function using test examples to help you debug.

Happy coding

consider what happens here if letter is cdeg. alphabet[0] is a, right?