var numbers = [1,-3,5,-6,-10,13,4,-8];
var numbers = [1,-3,5,-6,-10,13,4,-8];
var arr = numbers.slice(), sum = 0;
while((sum += arr.shift()) !== 0); // изысканный пустой while !
var index = numbers.length - arr.length - 1; // 5
function sum0(arr, idx = 0, sum = 0) {
if ((sum += numbers[idx]) === 0) return idx;
return sum0(arr, idx + 1, sum);
}
sum0([1,-3,5,-6,-10,13,4,-8]) // 5