@anonymous/

StandardLankyPossum

JavaScript

No description

fork
loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//http://www.freecodecamp.com/bonfires/missing-letters
function fearNotLetter(str) {
    missing = ""; 
  for (i = 1; i<str.length; i++)
    {
      current = str.charCodeAt(i);
      compare = str.charCodeAt(i-1);
      
      if (current > (compare+1)) {
          console.log('Missing letter is:' + (compare+1));
          missing =  String.fromCharCode(compare+1);
      } 
    }

if (missing === "") {
    return undefined; 
} else {
    return missing; 
}
  
}
fearNotLetter('abce');
Native Browser JavaScript