maps javascript converted to CoffeeScript