Ruby on Rails
PhpArray_filter

In Ruby, you would use the method filter with a block to filter arrays. For example, if you want to filter all numbers greater than 2:


arr = [1, 2, 3, 4]
arr.reject{|n| n > 2}

Would produce:


[1, 2]

And we have filtered all numbers > 2.

So, reject filters all elements for which the returns true.