filter out arrays js

JavaScript
let newArray = array.filter(function(item) {
  return condition;
});
Source

Also in JavaScript: