I have a map which either changes a value or sets it to nil. I then want to remove the nil entries from the list. The list doesn\'t need to be kept.
map
Thi
Definitely compact is the best approach for solving this task. However, we can achieve the same result just with a simple subtraction:
compact
[1, nil, 3, nil, nil] - [nil] => [1, 3]