JavaScript - Find out how many times a number goes into another number evenly
<p>Is there a simple way to find how many times a number goes into another number evenly in JavaScript?</p>

<p>Say 11 divided by 4 --- I know 4 goes into 11 2 times evenly</p>

<p>I have this code but I thought there was a simpler way that I maybe forgetting?</p>

<pre><code>&lt;script&gt;
a = 11;
b = 4;

i = a % b;
i2 = a - i;
solution = i2 / b;
document.write(solution); // 2
&lt;/script&gt;
</code></pre>
