Please consider an array such as :
arrayAll = [1,2,3,4,5,6,7,8,9]
Is there a package that enable to do partitioning to obtain :
arrayALLPartionned = [[1,2,3],[4,5,6],[7,8,9]]
I can see how to do this with a for loop but would appreciate a “pre-made” function if existing.
If using Underscore.js, you can implement this with
groupBy()andvalues()(This is less ugly in CoffeeScript.)
jsFiddle: http://jsfiddle.net/MW3BS/