<p dir="auto">Challenge <a href="https://www.freecodecamp.com/en/challenges/basic-javascript/generate-random-whole-numbers-within-a-range" rel="nofollow">generate-random-whole-numbers-within-a-range</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="

// Example
function ourRandomRange(ourMin, ourMax) {

return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin;
}

ourRandomRange(1, 9);

// Only change code below this line.

function randomRange(myMin, myMax) {

return Math.floor(Math.random() * (myMax - myMin + 1) + myMin); // Change this line

}

// Change these values to test your function
var myRandom = randomRange(5, 15);

    ```
"><pre class="notranslate"><span class="pl-c">// Example</span>
<span class="pl-k">function</span> <span class="pl-en">ourRandomRange</span><span class="pl-kos">(</span><span class="pl-s1">ourMin</span><span class="pl-kos">,</span> <span class="pl-s1">ourMax</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

<span class="pl-k">return</span> <span class="pl-v">Math</span><span class="pl-kos">.</span><span class="pl-en">floor</span><span class="pl-kos">(</span><span class="pl-v">Math</span><span class="pl-kos">.</span><span class="pl-en">random</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">*</span> <span class="pl-kos">(</span><span class="pl-s1">ourMax</span> <span class="pl-c1">-</span> <span class="pl-s1">ourMin</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c1">+</span> <span class="pl-s1">ourMin</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-en">ourRandomRange</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">9</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">// Only change code below this line.</span>

<span class="pl-k">function</span> <span class="pl-en">randomRange</span><span class="pl-kos">(</span><span class="pl-s1">myMin</span><span class="pl-kos">,</span> <span class="pl-s1">myMax</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

<span class="pl-k">return</span> <span class="pl-v">Math</span><span class="pl-kos">.</span><span class="pl-en">floor</span><span class="pl-kos">(</span><span class="pl-v">Math</span><span class="pl-kos">.</span><span class="pl-en">random</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">*</span> <span class="pl-kos">(</span><span class="pl-s1">myMax</span> <span class="pl-c1">-</span> <span class="pl-s1">myMin</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span><span class="pl-kos">)</span> <span class="pl-c1">+</span> <span class="pl-s1">myMin</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Change this line</span>

<span class="pl-kos">}</span>

<span class="pl-c">// Change these values to test your function</span>
<span class="pl-k">var</span> <span class="pl-s1">myRandom</span> <span class="pl-c1">=</span> <span class="pl-en">randomRange</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">15</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-s">``</span>`</pre></div>
<h4 dir="auto">Challenge Name</h4>
<p dir="auto">Generate Random Whole Numbers within a Range</p>
<h4 dir="auto">Issue Description</h4>
<p dir="auto">I think my code is correct. It meets the conditions if I log out the results to console but it will not pass the tests.</p>
<h4 dir="auto">Your Code</h4>

<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" // Example
function ourRandomRange(ourMin, ourMax) {

return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin;
}

ourRandomRange(1, 9);

// Only change code below this line.

function randomRange(myMin, myMax) {

return Math.floor( Math.random() * (myMax - myMin + 1)) + myMin; // Change this line

}

// Change these values to test your function
var myRandom = randomRange(5, 15);

"><pre class="notranslate"> <span class="pl-c">// Example</span>
<span class="pl-k">function</span> <span class="pl-en">ourRandomRange</span><span class="pl-kos">(</span><span class="pl-s1">ourMin</span><span class="pl-kos">,</span> <span class="pl-s1">ourMax</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

<span class="pl-k">return</span> <span class="pl-v">Math</span><span class="pl-kos">.</span><span class="pl-en">floor</span><span class="pl-kos">(</span><span class="pl-v">Math</span><span class="pl-kos">.</span><span class="pl-en">random</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">*</span> <span class="pl-kos">(</span><span class="pl-s1">ourMax</span> <span class="pl-c1">-</span> <span class="pl-s1">ourMin</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c1">+</span> <span class="pl-s1">ourMin</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-en">ourRandomRange</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">9</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">// Only change code below this line.</span>

<span class="pl-k">function</span> <span class="pl-en">randomRange</span><span class="pl-kos">(</span><span class="pl-s1">myMin</span><span class="pl-kos">,</span> <span class="pl-s1">myMax</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

<span class="pl-k">return</span> <span class="pl-v">Math</span><span class="pl-kos">.</span><span class="pl-en">floor</span><span class="pl-kos">(</span> <span class="pl-v">Math</span><span class="pl-kos">.</span><span class="pl-en">random</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">*</span> <span class="pl-kos">(</span><span class="pl-s1">myMax</span> <span class="pl-c1">-</span> <span class="pl-s1">myMin</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c1">+</span> <span class="pl-s1">myMin</span><span class="pl-kos">;</span> <span class="pl-c">// Change this line</span>

<span class="pl-kos">}</span>

<span class="pl-c">// Change these values to test your function</span>
<span class="pl-k">var</span> <span class="pl-s1">myRandom</span> <span class="pl-c1">=</span> <span class="pl-en">randomRange</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">15</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/21320527/18397729/1c051cac-768f-11e6-9b58-8c470689492f.png"><img src="https://cloud.githubusercontent.com/assets/21320527/18397729/1c051cac-768f-11e6-9b58-8c470689492f.png" alt="image" style="max-width: 100%;"></a></p>