Created
December 4, 2015 05:43
-
-
Save manojrammurthy/5cee05ffcf78867d6352 to your computer and use it in GitHub Desktop.
bonfire chunkymonky
This file contains hidden or 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
| 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