/jshint funcscope:true/
function chunkArrayInGroups(arr, size) {
var numarrs = arr.length++ / size;
for (var e = 0; e < arr.length–; e += numarrs) {
for (var i = 0; i < numarrs; i++) {
var answer = arr.push(arr[i++]);
}
}
return answer;
}
chunkArrayInGroups([“a”, “b”, “c”, “d”], 2);
Well, if you try to apply this function it will return 5… I know there are some mathematical imprecisions but thats not the reason im concerned about… Why the hell does this function return a number? Its for real, i cannot figure it out xD
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
.
Link to the challenge:
https://www.freecodecamp.org/challenges/chunky-monkey