title: Remove odd numbers in array
body: <p>I am trying to come up with another way to remove all of the odd numbers from an array. A friend was able to come up with this solution and I understand what it does, but I am failing to find another solution to it. Do you have any ideas for another solution to do this?</p>
  
  <p>JavaScript</p>
  
  <pre><code>let myArray = [1,3,5,7,9,2,4,6,8];
  let it = myArray.length;
  
  for(let i=0; i&lt;it; i++) {
    for(let j=0; j&lt;myArray.length; j++ )
      if(myArray[j]%2 === 1){
        myArray.splice(j,1)
        break;
      }
    };
  
    console.log(myArray);
  </code></pre>