const arr = [1,2,3,4,5,6]
let num = 10
let index = 3
while ( num > 0 ) {
if ( !arr[index] ) {
index = 0
}
arr[index] += 1
index++
num--
}
console.log( arr )
const newArr = [...Array(num)].reduce((acc, n, i) => (
acc[(index + i) % acc.length]++,
acc
), [...arr]);
// или
const newArr = arr.map(function(n, i, a) {
return n + this[0] + (((i - index) % a.length + a.length) % a.length < this[1]);
}, [ num / arr.length | 0, num % arr.length ]);
for (let i = num; i-- > 0; arr[(index + i) % arr.length]++) ;
// или
(function xxx(i) {
if (--i >= 0) {
arr[(index + i) % arr.length]++;
xxx(i);
}
})(num);