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.
[Parameters]
callbackFn
A function to execute for each element in the array. It should return a truthy value to keep the element in the resulting array, and a falsy value otherwise. The function is called with the following arguments:
element
The current element being processed in the array.
index
The index of the current element being processed in the array.
array
The array filter() was called upon.
thisArg(optional)
A value to use as. this wehn executing callbackFn.
[Return value]
A shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned.