2018-10-10 18:03:03 -04:00
---
id: af7588ade1100bde429baf20
title: Missing letters
isRequired: true
challengeType: 5
2019-08-28 16:26:13 +03:00
forumTopicId: 16023
2018-10-10 18:03:03 -04:00
localeTitle: Пропущенные буквы
---
## Description
2019-08-28 16:26:13 +03:00
<section id='description'>
2019-11-19 19:54:48 -05:00
Найдите отсутствующую букву в пробе прошедшего письма и верните е е . Если все буквы присутствуют в диапазоне, верните undefined. Н е забудьте использовать <a href="https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask,</a> если вы застряли. Попробуйте подключить программу. Напишите свой собственный код.
2019-08-28 16:26:13 +03:00
</section>
2018-10-10 18:03:03 -04:00
## Instructions
2019-08-28 16:26:13 +03:00
<section id='instructions'>
2018-10-10 18:03:03 -04:00
</section>
## Tests
<section id='tests'>
```yml
tests:
2019-08-28 16:26:13 +03:00
- text: <code>fearNotLetter("abce")</code> should return "d".
testString: assert.deepEqual(fearNotLetter('abce'), 'd');
- text: <code>fearNotLetter("abcdefghjklmno")</code> should return "i".
testString: assert.deepEqual(fearNotLetter('abcdefghjklmno'), 'i');
- text: <code>fearNotLetter("stvwx")</code> should return "u".
testString: assert.deepEqual(fearNotLetter('stvwx'), 'u');
- text: <code>fearNotLetter("bcdf")</code> should return "e".
testString: assert.deepEqual(fearNotLetter('bcdf'), 'e');
- text: <code>fearNotLetter("abcdefghijklmnopqrstuvwxyz")</code> should return undefined.
testString: assert.isUndefined(fearNotLetter('abcdefghijklmnopqrstuvwxyz'));
2018-10-10 18:03:03 -04:00
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function fearNotLetter(str) {
return str;
}
fearNotLetter("abce");
```
</div>
</section>
## Solution
<section id='solution'>
```js
2019-08-28 16:26:13 +03:00
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;
}
2018-10-10 18:03:03 -04:00
```
2019-08-28 16:26:13 +03:00
2018-10-10 18:03:03 -04:00
</section>