I just wondering if the array is updated after the checking_plus_1 is running
for(let i = array.length-1;i>0;i--){
if(k < test.length){
checking_plus_1(combine,array,test[k])
if(array[i] == 100 && array[i-1] == 100){
array[i] = array[j];
array[i-1] = array[j-1];
array[j] = test[k];
array[j-1] = test[k];
combine[j] = test[k];
combine[j-1] = test[k];
changeRowtoZero_minus_1(combine,array,i,i-1)
}
}
}
Despite I don't know your checking_plus_1 function, yes you can mutate your array in your for loop on each iteration.
You can also see the changes by adding console.log(array) in your for loop.