Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Handlebars.registerHelper 'forEach', (array, options) ->
return options.inverse @ if (options.inverse && !array.length)
array.map((item, index) ->
item.$index = index
item.$first = index is 0
item.$last = index is array.length - 1
options.fn item
).join ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.