`Array.map` already exposes `i` to the callback, you should be able to drop zipWithIndex by doing:
`types.map(function (type, i) { ... });`