<h4 dir="auto">Challenge Name</h4>

<p dir="auto">Replacing If Else Chains with Switch</p>
<h4 dir="auto">Issue Description</h4>

<p dir="auto">Tests are evaluating commented out code. In cases where existing if/else block is left in place and commented rather than deleted the tests fail.</p>
<p dir="auto">Looks to be similar if not the same issue affecting a different challenge reported in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="184992527" data-permission-text="Title is private" data-url="https://github.com/freeCodeCamp/freeCodeCamp/issues/11360" data-hovercard-type="issue" data-hovercard-url="/freeCodeCamp/freeCodeCamp/issues/11360/hovercard" href="https://github.com/freeCodeCamp/freeCodeCamp/issues/11360">#11360</a></p>
<h4 dir="auto">Browser Information</h4>

<ul dir="auto">
<li>Chrome, Version: 56.0.2924.87</li>
<li>Operating System: Windows 10</li>
<li>Mobile, Desktop, or Tablet: Desktop</li>
</ul>
<h4 dir="auto">Your Code</h4>

<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
![untitled](https://cloud.githubusercontent.com/assets/8456105/23828563/07185c06-072a-11e7-9f2b-e19014eecc39.jpg)
function chainToSwitch(val) {
  var answer = &quot;&quot;;
  // Only change code below this line
  
//   if (val === &quot;bob&quot;) {
//     answer = &quot;Marley&quot;;
//   } else if (val === 42) {
//     answer = &quot;The Answer&quot;;
//   } else if (val === 1) {
//     answer = &quot;There is no #1&quot;;
//   } else if (val === 99) {
//     answer = &quot;Missed me by this much!&quot;;
//   } else if (val === 7) {
//     answer = &quot;Ate Nine&quot;;
//   }
  switch(val){
    case &quot;bob&quot;:
      answer = &quot;Marley&quot;;
      break;
    case 42:
      answer = &quot;The Answer&quot;;
      break;
    case 1:
      answer = &quot;There is no #1&quot;;
      break;
    case 99:
      answer = &quot;Missed me by this much!&quot;;
      break;
    case 7:
      answer = &quot;Ate Nine&quot;;
      break;
  }
  // Only change code above this line  
  return answer;  
}

// Change this value to test
chainToSwitch(7);
"><pre class="notranslate"><span class="pl-c1">!</span><span class="pl-kos">[</span><span class="pl-s1">untitled</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-s1">https</span>:<span class="pl-c">//cloud.githubusercontent.com/assets/8456105/23828563/07185c06-072a-11e7-9f2b-e19014eecc39.jpg)</span>
<span class="pl-k">function</span> <span class="pl-en">chainToSwitch</span><span class="pl-kos">(</span><span class="pl-s1">val</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">var</span> <span class="pl-s1">answer</span> <span class="pl-c1">=</span> <span class="pl-s">""</span><span class="pl-kos">;</span>
  <span class="pl-c">// Only change code below this line</span>
  
<span class="pl-c">//   if (val === "bob") {</span>
<span class="pl-c">//     answer = "Marley";</span>
<span class="pl-c">//   } else if (val === 42) {</span>
<span class="pl-c">//     answer = "The Answer";</span>
<span class="pl-c">//   } else if (val === 1) {</span>
<span class="pl-c">//     answer = "There is no #1";</span>
<span class="pl-c">//   } else if (val === 99) {</span>
<span class="pl-c">//     answer = "Missed me by this much!";</span>
<span class="pl-c">//   } else if (val === 7) {</span>
<span class="pl-c">//     answer = "Ate Nine";</span>
<span class="pl-c">//   }</span>
  <span class="pl-k">switch</span><span class="pl-kos">(</span><span class="pl-s1">val</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-k">case</span> <span class="pl-s">"bob"</span>:
      <span class="pl-s1">answer</span> <span class="pl-c1">=</span> <span class="pl-s">"Marley"</span><span class="pl-kos">;</span>
      <span class="pl-k">break</span><span class="pl-kos">;</span>
    <span class="pl-k">case</span> <span class="pl-c1">42</span>:
      <span class="pl-s1">answer</span> <span class="pl-c1">=</span> <span class="pl-s">"The Answer"</span><span class="pl-kos">;</span>
      <span class="pl-k">break</span><span class="pl-kos">;</span>
    <span class="pl-k">case</span> <span class="pl-c1">1</span>:
      <span class="pl-s1">answer</span> <span class="pl-c1">=</span> <span class="pl-s">"There is no #1"</span><span class="pl-kos">;</span>
      <span class="pl-k">break</span><span class="pl-kos">;</span>
    <span class="pl-k">case</span> <span class="pl-c1">99</span>:
      <span class="pl-s1">answer</span> <span class="pl-c1">=</span> <span class="pl-s">"Missed me by this much!"</span><span class="pl-kos">;</span>
      <span class="pl-k">break</span><span class="pl-kos">;</span>
    <span class="pl-k">case</span> <span class="pl-c1">7</span>:
      <span class="pl-s1">answer</span> <span class="pl-c1">=</span> <span class="pl-s">"Ate Nine"</span><span class="pl-kos">;</span>
      <span class="pl-k">break</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
  <span class="pl-c">// Only change code above this line  </span>
  <span class="pl-k">return</span> <span class="pl-s1">answer</span><span class="pl-kos">;</span>  
<span class="pl-kos">}</span>

<span class="pl-c">// Change this value to test</span>
<span class="pl-s1">chainToSwitch</span><span class="pl-kos">(</span><span class="pl-c1">7</span><span class="pl-kos">)</span><span class="pl-kos"></span><span class="pl-kos">;</span></pre></div>
<h4 dir="auto">Screenshot</h4>

<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/8456105/23828565/17f8d0fa-072a-11e7-9df9-f48c008737fd.png"><img src="https://cloud.githubusercontent.com/assets/8456105/23828565/17f8d0fa-072a-11e7-9df9-f48c008737fd.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">When I complete the code that I have been working on for a bonfire there is sometimes something that I will want to change after I have already submitted and run my code. I then noticed that there will be multiple bonfire completions under your profile when you run the code more than once. This occurs even when you run the same code twice. Across the ~40,000 users that are signed up right now, it might save some significant drive space to only show one of these.</p>