Tell us what’s happening:
I can get the missing letters but accessing only the letters that are contained in str is proving to be quite difficult. I’ve tried nesting an if statement which I’m trying to create a separate variable missingLetter, only if the first statement is true.
Once I can isolate the letters inside strI think I’ve got it. Thanks for any help ![]()
Your code so far
const fearNotLetter = (str) => {
const range = "abcdefghijklmnopqrstuvwxyz";
let output = "";
let missingLetter = "";
for (let i = 0; i < range.length; i++) {
if (!str.includes(range[i])) {
output += range[i]
if (output.includes(str)) {
output += missingLetter;
}
} else {
console.log("apple");
}
}
return missingLetter;
}
console.log(fearNotLetter("bcdfg"))
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Challenge Information:
Build a Missing Letter Detector - Build a Missing Letter Detector