title: Separate negative and positive numbers in array with javascript
body: <p>I am trying to separate the negative &amp; positive elements of an array in Javascript, such that afterwards first come all negative elements and then the positive elements, each in the original order.</p>
  
  <h2>Example:</h2>
  
  <p>Input array:  &nbsp;&nbsp;&nbsp;<code>[1,2,-3,-2,4]</code><br>
  Output array: <code>[-3,-2,1,2,4]</code></p>
  
  <p>Input array: &nbsp;&nbsp;&nbsp;<code>[3,2,-1,0,-4,3,6,-7,-6]</code><br>
  Output array: <code>[-1,-4,-7,-6,3,2,0,3,6]</code></p>
  
  <p>I can do it using a temporary array with use of push() method, but how to do this without using a temporary array in that array only?</p>