Dictionary
collection isn't ordered, that is it simply doesn't guarantee to be ordered. But Array
is. Dictionary
adds values in discrete orders whereas Array
adds values in continuous order.
You simply can't have an Array
like this:
["a", "b", ... , "d", ... , ... , "g"] //Discrete index aren't allowed. You just can't skip any index in between.
Instead you have to have the above array like this:
["a", "b", "d", "g"]
To be able to get rid of this behavior, Dictionary
(where you don't have to maintain previous indexes to have values) was introduced. So you can insert values as you like. It won't bother you for maintaining any index.