Skip to content

Instantly share code, notes, and snippets.

@shawn42
Created July 8, 2011 12:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawn42/39ac06be6abc96c8a69e to your computer and use it in GitHub Desktop.
Save shawn42/39ac06be6abc96c8a69e to your computer and use it in GitHub Desktop.
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