how to split an array into two arrays in javascript?
<p>I have an array <code>var plans=[a, b, c, d ];</code> with prices based monthly any yearly.</p>

<p><code>Consider- a and b are monthly and c and d are yearly.</code></p>

<p>So, I want to split the array based on the monthly and yearly values and store the values in to separate arrays </p>

<pre><code>var monthly_plans=[]; and  var yearly_plans=[]
</code></pre>

<p>So, how do I do this? </p>

<p>I have used the js <code>split()</code> function before but on a very basic level.  </p>