Build a Missing Letter Detector - Build a Missing Letter Detector

Tell us what’s happening:

My function is passing every test except 4 and 5. I need to understand how to slice from the string’s starting position, not just from the alphabet’s beginning. I would appreciate any guidance to resolve this issue.

Your code so far

const alphabet = "abcdefghijklmnopqrstuvwxyz"

function fearNotLetter(string) {
  const targetString = alphabet.slice(string[0])
    for(let char of targetString) {
      if(string.includes(char) === false) {
        return char
      } 
  }
  
 return undefined
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36

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 @coder2026,

Here’s a good reference with examples for understanding what you can do with slice():

String.prototype.slice() - JavaScript | MDN

Hope that helps…

Happy coding

The issue is resolved! Thank you for the helpful resource!