Created
April 15, 2013 19:32
-
-
Save bnadlerjr/5390674 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array::partition = (callback) -> | |
[positive, negative] = [[], []] | |
for item, index in @ | |
(if callback item, index then positive else negative).push item | |
[positive, negative] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment