I'm referring to the #group_by method. The use example:
(1..6).group_by { |i| i%3 }
Shows an erroneous return value, namely:
#=> {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}. It should be:
{1=>[1, 4], 2=>[2, 5], 0=>[3, 6]}; I tried it in irb. I'm using ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19].
I'm referring to the
#group_by
method. The use example:Shows an erroneous return value, namely:
#=> {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}
. It should be:{1=>[1, 4], 2=>[2, 5], 0=>[3, 6]}
; I tried it inirb
. I'm usingruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
.Thanks.