Skip to content

Instantly share code, notes, and snippets.

@manojrammurthy
Created December 4, 2015 05:43
Show Gist options
  • Select an option

  • Save manojrammurthy/5cee05ffcf78867d6352 to your computer and use it in GitHub Desktop.

Select an option

Save manojrammurthy/5cee05ffcf78867d6352 to your computer and use it in GitHub Desktop.
bonfire chunkymonky
function chunk(arr,size){
var temp=[];
for(var i=0; i<arr.length; i){
temp.push(arr.slice(i,i+=size));
}
return temp;
}
chunk(['a', 'b', 'c', 'd'], 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment