Skip to content

Instantly share code, notes, and snippets.

@milafrerichs
Created November 4, 2013 11:13
Show Gist options
  • Save milafrerichs/7301158 to your computer and use it in GitHub Desktop.
Save milafrerichs/7301158 to your computer and use it in GitHub Desktop.
Split an array into two halfs
[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