ary.compact â new_ary
Instance Public methods
Returns a copy of self
with all nil
elements
removed.
[ "a", nil, "b", nil, "c", nil ].compact #=> [ "a", "b", "c" ]
Returns a copy of self
with all nil
elements
removed.
[ "a", nil, "b", nil, "c", nil ].compact #=> [ "a", "b", "c" ]
Please login to continue.