Actions
Feature #13657
closedSimplify usage of Enumerable#reject
Status:
Rejected
Assignee:
-
Target version:
-
Description
The reject method is more complicated than it has to be when removing only a specific value.
It would be convenient if we could just plug in the value we wish to delete as an optional argument, for example:
[1, 2, 3, 4].reject(3) # => [1, 2, 4]
as apposed to:
[1, 2, 3, 4].reject { |element| element == 3 } # => [1, 2, 4]
The next best method I can think of is #delete
, but that returns the value which is deleted.
Actions
Like0
Like0Like0Like0