With arrays, you can filter based on a condition:
[i for i=1:10 if isodd(i) ]
returns:
5-element Vector{Int64}:
1
3
5
7
9
but attempting something similar with map results in nothing values:
julia> map(1:10) do i
isodd(i) ? i : nothing
end
reutrns:
10-element Vector{Union{Nothing, Int64}}:
1
nothing
3
nothing
5
nothing
7
nothing
9
nothing