Iterates over the elements in an array, returning an array with only the elements for which the callback returns truthy.