Replace Array.map with old-fashioned for loop

`Array.map` is not supported in IE8