The filter() method creates a shallow copy of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function (true or false).
const filteredItem = items.filter((item) => item.age < 40)
const result = words.filter((word) => word.length < 6)