filter javascript array

JavaScript
let newArray = array.filter(function(item) {
  return condition;
});var words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];

const result = words.filter(word => word.length > 6);

console.log(result);var newArray = array.filter(function(item) {
  return condition;
});
Source

Also in JavaScript: