Finding even or odd numbers
You can use Array.prototype.filter.
You can read like this: return an array that only has the elements which satisfies the return function expression.
This way, you can avoid instantiating an array and only after this iteration to make the push.


var numList = [];
while(numList.length &lt; 5){
  numList.push(window.prompt());
}

var evenNumbers = numList.filter(function (element) {
  return element % 2 === 0
});
// that's the same that 
// var evenNumbers = numList.filter(element =&gt; element % 2 === 0);

document.write(evenNumbers);



Although, you can use arrow functions, that has a cleaner syntax.