documentcloud/underscore — pull request #983 by breck7 (2013-02-24 19:26:05+00:00)
Title: Idea for cycle method

**I'm relatively new to the underscore style of programming so for all I know there's already a method that does exactly what this does. Sorry if this is a dupe!**

When iterating over a collection, I often have to add edge case code for the first element and the last element. This method _.cycle, is just like map, except it accepts an optional additional function to apply to the first element in the collection, and an optional additional function to apply to the last element in the collection.