A way to initialize an array without specifying its eltype in advance?

Or map: it also produces a collection with an element type that contains what actually goes in the array. For example:

julia> a = [rand(Bool) ? rand(1:10) : randstring() for _ = 1:10]
10-element Vector{Any}:
 9
  "UUa9X3To"
 6
  "5NAPmkJw"
 9
 9
 7
 1
 2
  "aCmCF7vc"

julia> map(length, a)
10-element Vector{Int64}:
 1
 8
 1
 8
 1
 1
 1
 1
 1
 8
4 Likes