A common pattern within jQuery is a method that takes a callback which is passed an element of an array and its index within that array. However, it seems completely random
According to https://learn.jquery.com/using-jquery-core/iterating/
A word of warning: $.map() switches the order of callback arguments [when compared to $().map, $each() and $().each()].
This was done in order to match the native JavaScript .map() method
made available in ECMAScript 5.