When using collect(), it requires two parameters, the element type and the collection.
When you’re creating an array from dictionary keys what should the element type parameter be?
character_inventory = Dict{String,Int32}("Sword" => 100, "Staff" => 50)
character_inventory_keys = keys(character_inventory)
# Prints Base.KeySet{String,Dict{String,Int32}}
println(typeof(character_inventory_keys))
println(collect(character_inventory_keys))
If I place KeySet{String,Dict{String,Int32}}
as the first parameter it produces an error.
I’m aware that I don’t necessarily need the type, I can just call collect(character_inventory_keys)
but in the interest of learning, I thought I would ask.