# Post Help: Chunky Monkey

**URL:** <https://forum.freecodecamp.org/t/post-help-chunky-monkey/434897>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [December 11, 2020, 10:49am UTC](https://forum.freecodecamp.org/t/post-help-chunky-monkey/434897 "2020-12-11T10:49:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![abdulrahman.mhd.anas](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/abdulrahman.mhd.anas/32/135050_2.png) [@abdulrahman.mhd.anas](https://forum.freecodecamp.org/u/abdulrahman.mhd.anas)\
**Post date:** [December 12, 2020, 8:16am UTC](https://forum.freecodecamp.org/t/post-help-chunky-monkey/434897/4 "2020-12-12T08:16:05Z")

</div>

**Tell us what’s happening:**  
This code below is a solution number 2 of chunky monkey challenge Guide  
link: [freeCodeCamp Challenge Guide: Chunky Monkey](https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-chunky-monkey/16005)

I did not understand the code too much specially this line: `newArray.push(arr.slice(i, i + size));`

**Your code so far**

```auto
function chunkArrayInGroups(arr, size) {
let newArray = [];
for (let i = 0; i < arr.length; i += size) {
newArray.push(arr.slice(i, i + size));
}
return newArray;
}

console.log(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4));

```

> [@abdulrahman.mhd.anas](#):
>
> **Link to the challenge:**
> 
> ![](https://www.freecodecamp.org/favicon-32x32.png?v=6cba562cbd10e31af925a976f3db73f7) [freecodecamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey)
> 
> ![](https://cdn.freecodecamp.org/platform/universal/fcc_meta_1920X1080-indigo.png)
> 
> ### [freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey)
> 
> Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.

---

_[View the full topic](https://forum.freecodecamp.org/t/post-help-chunky-monkey/434897)._
