# Missing letters-what is wrong with my solution?

**URL:** <https://forum.freecodecamp.org/t/missing-letters-what-is-wrong-with-my-solution/589677>\
**Category:** Curriculum Help\
**Created:** [February 3, 2023, 5:41pm UTC](https://forum.freecodecamp.org/t/missing-letters-what-is-wrong-with-my-solution/589677 "2023-02-03T17:41:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkhuu79](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/tkhuu79/32/299999_2.png) [@tkhuu79](https://forum.freecodecamp.org/u/tkhuu79)\
**Post date:** [February 3, 2023, 5:41pm UTC](https://forum.freecodecamp.org/t/missing-letters-what-is-wrong-with-my-solution/589677/1 "2023-02-03T17:41:58Z")

</div>

Does anyone know why this solution won’t pass the tests?

```javascript
function fearNotLetter(str) {
  let alphabet = "abcdefghijklmnopqrstuvwxyz";

  let startingPoint = alphabet.indexOf(str[0]);
  let endingPoint = alphabet.indexOf(str[str.length - 1]);

  let strSub = alphabet.substring(startingPoint, endingPoint);
  let strSubSplit = strSub.split('');
  let strSplit = str.split('');
   
  let x = strSubSplit.map(function(e){
      return strSplit.indexOf(e) < 0;
      
  });
 return x.toString();
}

```

---

<div class="post-metadata">

**Author:** ![hbar1st](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/hbar1st/32/372649_2.png) [@hbar1st](https://forum.freecodecamp.org/u/hbar1st)\
**Post date:** [February 3, 2023, 5:51pm UTC](https://forum.freecodecamp.org/t/missing-letters-what-is-wrong-with-my-solution/589677/2 "2023-02-03T17:51:50Z")

</div>

hi please post a link to the challenge you are trying to solve.

Usually when your solution is wrong the testcases will tell you which one failed and you can then try that testcase and see for yourself what output you get. (using console.log to determine how to move forward)

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [February 3, 2023, 6:02pm UTC](https://forum.freecodecamp.org/t/missing-letters-what-is-wrong-with-my-solution/589677/3 "2023-02-03T18:02:54Z")

</div>

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (').

  

We can’t help without knowing more about what is wrong and what you’ve done so far.  
What isn’t working as expected? What tests are failing? What specific behavior of piece of the code are you stuck on?

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [February 3, 2023, 8:07pm UTC](https://forum.freecodecamp.org/t/missing-letters-what-is-wrong-with-my-solution/589677/5 "2023-02-03T20:07:41Z")

</div>

I assume you meant to use `filter` and not `map`. You will still not pass the last test but that is a simple fix as you can return `undefined` instead of an empty string.

```auto
console.log("" || undefined) // undefined

```

---

<div class="post-metadata">

**Author:** ![tkhuu79](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/tkhuu79/32/299999_2.png) [@tkhuu79](https://forum.freecodecamp.org/u/tkhuu79)\
**Post date:** [February 11, 2023, 3:31pm UTC](https://forum.freecodecamp.org/t/missing-letters-what-is-wrong-with-my-solution/589677/7 "2023-02-11T15:31:10Z")

</div>

I am sorry. I am a little frustrated so I have not checked for a few days. Here is the link to the challenge Missing Letters:

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/missing-letters)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [August 13, 2023, 3:31am UTC](https://forum.freecodecamp.org/t/missing-letters-what-is-wrong-with-my-solution/589677/8 "2023-08-13T03:31:13Z")

</div>

Closed on August 13, 2023, 3:31am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
