# Bug in #94? Never set value to a variable that was required

**URL:** <https://forum.freecodecamp.org/t/bug-in-94-never-set-value-to-a-variable-that-was-required/180604>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [March 20, 2018, 12:30am UTC](https://forum.freecodecamp.org/t/bug-in-94-never-set-value-to-a-variable-that-was-required/180604 "2018-03-20T00:30:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brwellstx](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@brwellstx](https://forum.freecodecamp.org/u/brwellstx)\
**Post date:** [March 20, 2018, 12:30am UTC](https://forum.freecodecamp.org/t/bug-in-94-never-set-value-to-a-variable-that-was-required/180604/1 "2018-03-20T00:30:18Z")

</div>

I wasn’t paying attention to the requirements and just started typing. My code produced the correct results but skipped setting a value to the variable “answer”. Is this normal since the return value was correct or is it a bug in the problem.

**Your code so far**

```auto
function caseInSwitch(val) {
  var answer = "";
  // Only change code below this line
  switch (val) {
    case 1:
      return "alpha";
      break;
    case 2:
      return "beta";
      break;
    case 3:
      return "gamma";
      break;
    case 4:
      return "delta";
      break;      
  }
  
  
  // Only change code above this line  
  return answer;  
}

// Change this value to test
caseInSwitch(1);

```

**Your browser information:**

Your Browser User Agent is: `Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36`.

**Link to the challenge:**  
[https://www.freecodecamp.org/challenges/selecting-from-many-options-with-switch-statements](https://www.freecodecamp.org/challenges/selecting-from-many-options-with-switch-statements)

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [February 2, 2021, 11:56am UTC](https://forum.freecodecamp.org/t/bug-in-94-never-set-value-to-a-variable-that-was-required/180604/3 "2021-02-02T11:56:56Z")

</div>

Closed on February 2, 2021, 11:56am UTC


