I need help with the ability to divide an unknown integer into a given number of even parts — or at least as even as they can be. The sum of the parts should be the original
var splitInteger = function(num, parts) {
// Complete this function
var val;
var mod = num % parts;
if(mod == 0){
val = num/parts;
retData = Array(parts).fill(val);
} else {
val = (num-mod)/parts;
retData = Array(parts).fill(val);
for(i=0;i