Tell us what’s happening:
So I struggled a lot with this one but eventually found my way to a solution. After I checked the solutions given I feel like mine was terrible. Anyway I was hoping to get some feedback on just how bad it is I guess.
Your code so far
function fearNotLetter(str) {
const arr = [];
const originalArr = str.split('');
for (let letter = 0; letter < str.length - 1; letter++){
const ascii = (str.charCodeAt(letter) + 1);
arr.push((String.fromCharCode(ascii)));
}
return (arr.filter(element => !originalArr.includes(element)).join('') || undefined);
}
fearNotLetter("abcdefghijklmnopqrstuvwxyz");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0
Challenge: Intermediate Algorithm Scripting - Missing letters
Link to the challenge: