Tell us what’s happening:
Describe your issue in detail here.
My Frankenstein code seems to work, but I’ve been feeling a bit stupid and like I missed classes.
Where can I find the lessons on all the fancy functions? Every lesson seems to throw me into the deep end. Or does everyone just “hit the ground running” hoping not to fall into the rabbit hole?
function fearNotLetter(str) {
let alfa = "abcdefghijklmnopqrstuvwxyz";
let letters = str.split("");
let fl = letters[0]; //first letter
let ll = letters[(letters.length - 1)] //last letter
let io = [] //indexOf array
let count = []; //alfa count from first to last letter
for (let i = alfa.indexOf(fl); i <= alfa.indexOf(ll); i++) {
count.push(i);
}
for (let i = 0; i < letters.length; i++) {
io.push(alfa.indexOf(letters[i]));
}
if (count.length === io.length){
return undefined;
} else {
let notIn = count.filter(l => io.indexOf(l) == -1);
return alfa[notIn];
}
}