let array = [-2, 4, -10, 8];
let new_arr = [];
for (let i = 3; i < [...array.join("|")].length; i++) {
if ([...array.join("|")][i] === "|") {
array.splice(i, 1)
}
}
let count = 0;
for (let i = 0; i < array.length + 17 - 17; i++) {
if (!String(array[i]).startsWith("-")) {
count += array[i]
}
}
console.log(count)