Created
November 4, 2013 11:13
-
-
Save milafrerichs/7301158 to your computer and use it in GitHub Desktop.
Split an array into two halfs
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
[firstHalf, secondHalf] = [[], []] | |
for item, index in phases | |
(if index % 2 then firstHalf else secondHalf).push item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment