Possible Bug with missing letters challenge

I think there may be a possible bug on this challenge because my code works well on a different environment. Please help me check it out and tell me what I’m missing so far. Thanks in advance. Here is the challenge link missing letters challenge

function fearNotLetter(str) {  
   let word = "abcdefghijklmnopqrstuvwxyz"; 
    const start = word.indexOf(str[0]);  
const end = word.indexOf(str[str.length - 1]);  
let section = word.slice(start, end + 1);   
 if(section === str) {    
    return undefined;  
}else{  
    section.split("").map(letter => {     
     if(str.includes(letter) == false){        
        return letter;      
     }    
   });  
  }  
}

this is the line that is supposed to return the missing letter correct?

However, it returns it to the ‘map’ which doesn’t return it anywhere… (so the actual function ‘fearNotLetter’ doesn’t return anything, only your ‘map’ returns something)

try to find a way to return the letter from the function , not just to the map…

Oh… Thanks a lot. You’re God-sent!!!
I added the following line of code at the end of the else section and it worked.

const ans = section.map... 

then I returned

ans.join("");

:sparkler: Thank you once again.

1 Like