Pairs index API

Why are these different?

julia> first(pairs([10,20,30]))
1 => 10

julia> pairs([10,20,30])[1]
10

first treats it like an iterator but getindex treats it like a key-value map

3 Likes