title: Javascript - removing negative values in an array only using the pop() method
body: <p>I am trying to remove the negative numbers in this array using only the pop() method in Javascript. I know pop() removes the last item so how would I use pop() to remove both negative numbers in this array? Thank you!</p>
  
  <pre><code>var x = [-3,5,1,3,2,10,-7];
  for (var i = x.length-1; i &gt;= 0; i--){
    if (x[i] &lt; 0){
      x.pop(x[i]);
    }
  }
  console.log(x)
  </code></pre>