Map and Remove nil values (Ruby)

use compact

[1, nil, 3, nil, nil].compact
=> [1, 3]
Written on May 19, 2019, Last update on May 19, 2019
ruby map