With the arrays, you have the filter() method to filter the elements of the array with a specific condition. For example with an array of numbers, you want to retrieve only the element greater than 50.
The filter() doesnβt change the original array. It returns a new array with the elements that satisfy the condition.
If the element is an object you can filter for the attribute of the object. For example, if you have objects like this one:
and you have an array of elements, and you want to filter and retrieve the object with a price greater (or equal) than 150: