Flowdock
compact!() public

Removes nil elements from array. Returns nil if no changes were made.

[ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ]
[ "a", "b", "c" ].compact!           #=> nil
Show source
Register or log in to add new notes.