In a similar way to map(), the filter() method creates a new array. However, this method only returns the elements that pass the test provided in the callback function. In this example, the method will return only the elements that start with a "b"
Read more at: https://imelgrat.me/javascript/array-object-iteration-javascript/