lyonbros/composer.js — pull request #7 by squidfunk (2012-03-15 12:03:46+00:00)
Title: Added Collection.map() in order to execute a function on all models and return the results

Hey folks,

this pull-request is more a suggestions than a bugfix. I had to execute a function on a collections models lately quite often, so I wrote a wrapper for it (exactly like `Collection.each`). So now, instead of the rather ugly way:

results = mycollection.models().map(function(item) { ... })

... you can now do:

results = mycollection.map(function(item) { ... })

Hope you like it and it fits the overall context.

All the best,
Martin