Actions
Misc #11520
closedInconsistent behavior in Array#compact!
Status:
Rejected
Assignee:
-
Description
I noticed that Array#compact!
sometimes returns self
and other times nil
. This behavior was a bit confusing.
[].compact!
# => nil
[1].compact!
# => nil
[nil].compact!
# => []
[1, nil].compact!
# => [1]
I would prefer that Array#compact!
either always returns nil
, or always returns self
.
Actions
Like0
Like0Like0Like0