daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Jun 17th, 2016 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function chunkArrayInGroups(arr, size) {
  3.   // Break it up.
  4.   var newVar =[];
  5.  
  6.   for (var i=0; i<=((arr.length)/size); i++){
  7.     //  if (i ==2){
  8.     //     return arr;
  9.     //   }
  10.        newVar[i]=arr.splice(0, size);
  11.   }
  12.   return newVar;
  13. }
  14.  
  15. chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top