ary.compact! â ary or nil
Instance Public methods
Removes nil
elements from the array.
Returns nil
if no changes were made, otherwise returns the
array.
[ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ] [ "a", "b", "c" ].compact! #=> nil
Please login to continue.