Create a gist now

Instantly share code, notes, and snippets.

@shawn42 /trixies.coffee Secret
Created Jul 8, 2011

IE_lost_without_a_map
# broken
_(candies).filter((candy) ->
candy.isChocalate?
).map (candy) ->
candy.yummy()
# plays well with IE8
_(_(candies).filter((candy) ->
candy.isChocalate?
)).map (candy) ->
candy.yummy()
# allows for more method chaining
_(candies).chain().filter((candy) ->
candy.isChocalate?
).map((candy) ->
candy.yummy()
).value()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment