Hi, I have typed a code for the chunky monkey algorithm.
I used my code with Virtual Studio Code and it worked, but it did not with freeCode camp and would like for someone to give me a hint as to why might it be incorrect when trying it out in freeCode Camp.
This is the code (I used array “a” as an example):
let a=["a", "b", "c", "d", "e"]
function splitting(array,size) {
b=[];
let n=array.length/size;
for (i=0; i<n; i++){
b.push(array.splice(0,size));
}
return b;
}
Thank you in advance for any help I can get.