Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Check Out My YouTube Channel

Check Out More Algorithms like this at FreeCodeCamp


Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a two-dimensional array.

Example

  • chunkyMonkey(["a", "b", "c", "d"], 2) should return [["a", "b"], ["c", "d"]].
  • chunkyMonkey([0, 1, 2, 3, 4, 5], 4) should return [[0, 1, 2, 3], [4, 5]].

Hints

  • slice()