--- id: af7588ade1100bde429baf20 title: Missing letters isRequired: true challengeType: 5 --- ## Description
Find the missing letter in the passed letter range and return it. If all letters are present in the range, return undefined. Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code.
## Instructions
## Tests
```yml tests: - text: fearNotLetter("abce") should return "d". testString: 'assert.deepEqual(fearNotLetter("abce"), "d", "fearNotLetter("abce") should return "d".");' - text: fearNotLetter("abcdefghjklmno") should return "i". testString: 'assert.deepEqual(fearNotLetter("abcdefghjklmno"), "i", "fearNotLetter("abcdefghjklmno") should return "i".");' - text: fearNotLetter("stvwx") should return "u". testString: 'assert.deepEqual(fearNotLetter("stvwx"), "u", "fearNotLetter("stvwx") should return "u".");' - text: fearNotLetter("bcdf") should return "e". testString: 'assert.deepEqual(fearNotLetter("bcdf"), "e", "fearNotLetter("bcdf") should return "e".");' - text: fearNotLetter("abcdefghijklmnopqrstuvwxyz") should return undefined. testString: 'assert.isUndefined(fearNotLetter("abcdefghijklmnopqrstuvwxyz"), "fearNotLetter("abcdefghijklmnopqrstuvwxyz") should return undefined.");' ```
## Challenge Seed
```js function fearNotLetter(str) { return str; } fearNotLetter("abce"); ```
## Solution
```js function fearNotLetter (str) { for (var i = str.charCodeAt(0); i <= str.charCodeAt(str.length - 1); i++) { var letter = String.fromCharCode(i); if (str.indexOf(letter) === -1) { return letter; } } return undefined; } ```