Skip to content

Instantly share code, notes, and snippets.

@Chadtech
Last active August 29, 2015 14:14
Show Gist options
  • Save Chadtech/94a42c192df766ef2138 to your computer and use it in GitHub Desktop.
Save Chadtech/94a42c192df766ef2138 to your computer and use it in GitHub Desktop.
###########
# PROCESS 0
###########
A = [ '0', '1', '2', '3' ]
B = [ '4', '5', '6', '7' ]
C = [ '8', '9', 'a', 'b' ]
D = [ 'c', 'd', 'e', 'f' ]
chunks = [ A, B, C, D ]
content = _.reduce chunks, (memo, chunk) ->
memo.concat chunk
# content = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' ]
###########
# PROCESS 1
###########
content = []
A = [ '0', '1', '2', '3' ]
B = [ '4', '5', '6', '7' ]
C = [ '8', '9', 'a', 'b' ]
D = [ 'c', 'd', 'e', 'f' ]
chunks = [ A, B, C, D ]
_.forEach chunks, (chunk) ->
_.forEach chunk, (datum) ->
content.push datum
# content = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment