Actions
Feature #5766
closedHash.each_with_object should behave differently when block's arity is 3
Feature #5766:
Hash.each_with_object should behave differently when block's arity is 3
Status:
Closed
Assignee:
-
Target version:
-
Description
Enum.each_with_object is very handy in lots of situations, but specially while dealing with arrays. It would be great to be able to use it with hashes like below:
{a: 1}.each_with_object([]){|k, v, object| ...}
Currently, we need to do
{a: 1}.each_with_object([]) do |pair, object|
k, v = pair
...
end
Actions