<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-target-the-parent-of-an-element-using-jquery" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-target-the-parent-of-an-element-using-jquery</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.<br>
<a target="_blank" rel="noopener noreferrer" href=""><img src="" alt="Uploading Screen Shot 2015-09-03 at 22.45.36.png…" style="max-width: 100%;"></a><br>
i am doing correctly but the objective is being crossed</p>
<h4 dir="auto">Challenge Name</h4>
<p dir="auto">Roman Numeral Converter</p>
<h4 dir="auto">Issue Description</h4>

<p dir="auto">I'm reporting this based on my tests of an issue another camper reported on the forums.</p>
<p dir="auto">The thread may be found here <a href="http://forum.freecodecamp.com/t/roman-numeral-solution-not-working/21474" rel="nofollow">on the FCC forum</a></p>
<p dir="auto">The code pasted below fails all tests for this challenge, even though it is returning the correct answer.</p>
<p dir="auto">Moving <code class="notranslate">var converted = []</code> inside the function returns the exact same result, yet passes all tests.</p>
<h4 dir="auto">Browser Information</h4>

<ul dir="auto">
<li>Browser Name, Version: Chrome / Firefox - latest</li>
<li>Operating System: Mac OSX El Capitan / Ubuntu 16.04</li>
<li>Mobile, Desktop, or Tablet:</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="var converted = [];

function convertToRoman(num) {
  //use roman numerial char codes

  var romans = [{
    1: &quot;I&quot;,
    2: &quot;II&quot;,
    3: &quot;III&quot;,
    4: &quot;IV&quot;,
    5: &quot;V&quot;,
    6: &quot;VI&quot;,
    7: &quot;VII&quot;,
    8: &quot;VIII&quot;,
    9: &quot;IX&quot;
  }, {
    1: &quot;X&quot;,
    2: &quot;XX&quot;,
    3: &quot;XXX&quot;,
    4: &quot;XL&quot;,
    5: &quot;L&quot;,
    6: &quot;LX&quot;,
    7: &quot;LXX&quot;,
    8: &quot;LXXX&quot;,
    9: &quot;XC&quot;
  }, {
    1: &quot;C&quot;,
    2: &quot;CC&quot;,
    3: &quot;CCC&quot;,
    4: &quot;CD&quot;,
    5: &quot;D&quot;,
    6: &quot;DC&quot;,
    7: &quot;DCC&quot;,
    8: &quot;DCCC&quot;,
    9: &quot;CM&quot;
  }, {
    1:&quot;M&quot;
  }];

  var stringedNum = num.toString().split(&quot;&quot;).reverse().join(&quot;&quot;);//63


  for (i = 0; i &lt; stringedNum.length; i++) {

    switch (i) {
      case 0:
        converted.push(romans[0][stringedNum[i]]);
        break;
      case 1:
        converted.push(romans[1][stringedNum[i]]);
        break;
      case 2:
        converted.push(romans[2][stringedNum[i]]);
        break;
      case 3:
        converted.push(romans[3][1].repeat([stringedNum[i]]));
        break;
      case -1:
        console.log(&quot;-1&quot;);
        alert(&quot;No number!&quot;);
        break;
    }
  }
  //63. 
  return converted.reverse().join(&quot;&quot;);
}

convertToRoman(2); "><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">converted</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>

<span class="pl-k">function</span> <span class="pl-en">convertToRoman</span><span class="pl-kos">(</span><span class="pl-s1">num</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-c">//use roman numerial char codes</span>

  <span class="pl-k">var</span> <span class="pl-s1">romans</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">{</span>
    <span class="pl-c1">1</span>: <span class="pl-s">"I"</span><span class="pl-kos">,</span>
    <span class="pl-c1">2</span>: <span class="pl-s">"II"</span><span class="pl-kos">,</span>
    <span class="pl-c1">3</span>: <span class="pl-s">"III"</span><span class="pl-kos">,</span>
    <span class="pl-c1">4</span>: <span class="pl-s">"IV"</span><span class="pl-kos">,</span>
    <span class="pl-c1">5</span>: <span class="pl-s">"V"</span><span class="pl-kos">,</span>
    <span class="pl-c1">6</span>: <span class="pl-s">"VI"</span><span class="pl-kos">,</span>
    <span class="pl-c1">7</span>: <span class="pl-s">"VII"</span><span class="pl-kos">,</span>
    <span class="pl-c1">8</span>: <span class="pl-s">"VIII"</span><span class="pl-kos">,</span>
    <span class="pl-c1">9</span>: <span class="pl-s">"IX"</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
    <span class="pl-c1">1</span>: <span class="pl-s">"X"</span><span class="pl-kos">,</span>
    <span class="pl-c1">2</span>: <span class="pl-s">"XX"</span><span class="pl-kos">,</span>
    <span class="pl-c1">3</span>: <span class="pl-s">"XXX"</span><span class="pl-kos">,</span>
    <span class="pl-c1">4</span>: <span class="pl-s">"XL"</span><span class="pl-kos">,</span>
    <span class="pl-c1">5</span>: <span class="pl-s">"L"</span><span class="pl-kos">,</span>
    <span class="pl-c1">6</span>: <span class="pl-s">"LX"</span><span class="pl-kos">,</span>
    <span class="pl-c1">7</span>: <span class="pl-s">"LXX"</span><span class="pl-kos">,</span>
    <span class="pl-c1">8</span>: <span class="pl-s">"LXXX"</span><span class="pl-kos">,</span>
    <span class="pl-c1">9</span>: <span class="pl-s">"XC"</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
    <span class="pl-c1">1</span>: <span class="pl-s">"C"</span><span class="pl-kos">,</span>
    <span class="pl-c1">2</span>: <span class="pl-s">"CC"</span><span class="pl-kos">,</span>
    <span class="pl-c1">3</span>: <span class="pl-s">"CCC"</span><span class="pl-kos">,</span>
    <span class="pl-c1">4</span>: <span class="pl-s">"CD"</span><span class="pl-kos">,</span>
    <span class="pl-c1">5</span>: <span class="pl-s">"D"</span><span class="pl-kos">,</span>
    <span class="pl-c1">6</span>: <span class="pl-s">"DC"</span><span class="pl-kos">,</span>
    <span class="pl-c1">7</span>: <span class="pl-s">"DCC"</span><span class="pl-kos">,</span>
    <span class="pl-c1">8</span>: <span class="pl-s">"DCCC"</span><span class="pl-kos">,</span>
    <span class="pl-c1">9</span>: <span class="pl-s">"CM"</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
    <span class="pl-c1">1</span>:<span class="pl-s">"M"</span>
  <span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">;</span>

  <span class="pl-k">var</span> <span class="pl-s1">stringedNum</span> <span class="pl-c1">=</span> <span class="pl-s1">num</span><span class="pl-kos">.</span><span class="pl-en">toString</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">split</span><span class="pl-kos">(</span><span class="pl-s">""</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">reverse</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s">""</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-c">//63</span>


  <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">i</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">stringedNum</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span> <span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

    <span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">case</span> <span class="pl-c1">0</span>:
        <span class="pl-s1">converted</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">romans</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s1">stringedNum</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">]</span><span class="pl-kos">)</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">converted</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">romans</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s1">stringedNum</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">]</span><span class="pl-kos">)</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">2</span>:
        <span class="pl-s1">converted</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">romans</span><span class="pl-kos">[</span><span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s1">stringedNum</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">]</span><span class="pl-kos">)</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">3</span>:
        <span class="pl-s1">converted</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">romans</span><span class="pl-kos">[</span><span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">repeat</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s1">stringedNum</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">)</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">-</span><span class="pl-c1">1</span>:
        <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"-1"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-en">alert</span><span class="pl-kos">(</span><span class="pl-s">"No number!"</span><span class="pl-kos">)</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-kos">}</span>
  <span class="pl-c">//63. </span>
  <span class="pl-k">return</span> <span class="pl-s1">converted</span><span class="pl-kos">.</span><span class="pl-en">reverse</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s">""</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-en">convertToRoman</span><span class="pl-kos">(</span><span class="pl-c1">2</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/322175/16969512/f2b5d346-4dda-11e6-97dd-8abc9366d4f3.png"><img src="https://cloud.githubusercontent.com/assets/322175/16969512/f2b5d346-4dda-11e6-97dd-8abc9366d4f3.png" alt="roman numeral converter free code camp" style="max-width: 100%;"></a></p>