Tell us what’s happening:
I am passing every test except 4 and 5. I understand that the “changer” variable is parsed through with my for loop, but I don’t understand how to create a string that is iterable from the start of the string to the string’s end. When I output the given code, I receive, “d” for fearNotLetter(“abce”) and, “a” for fearNotLetter(“stvwx”); I don’t understand why the call does not loop from the start of “stvwx”.
Your code so far
function fearNotLetter(string) {
const alphabet = "abcdefghijklmnopqrstuvwxyz";
let missing = "";
let changer = string.slice(0);
console.log(changer);
for (let letter of alphabet) {
if (!changer.includes(letter)){
missing += letter;
return missing;
}}
}
console.log(fearNotLetter("abce"));
console.log(fearNotLetter("stvwx"));
console.log(fearNotLetter("abcdefghijklmnopqrstuvwxyz"));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
Challenge Information:
Build a Missing Letter Detector - Build a Missing Letter Detector