This example code is misleading. The first parameter returned from an enumerated Swift dictionary “is a counter for the enumeration, but is not necessarily the index of the paired value.” Calling the counter ‘key’ or ‘index’ and the dictionary key ‘key’ adds to the confusion.