filter array if object value is equeal to code example
Example 1: filter out arrays js
let newArray = array.filter(function(item) {
return condition;
});
Example 2: does filter change original array
Note: filter() does not change the original array.