Return a shallow copy of an array containing only those elements which pass a test implemented by a predicate function.