Add filter function to arrays.