function getArraysSum(arr1, arr2) {
let sum = 0;
for (let i = 0; i < arr1.length && i < arr2.length; i++) {
sum += arr1[i] && arr2[i];
}
return sum;
}
const sum = (...args) => (
args.flat().reduce((acc, next) => acc += next, 0)
)
function sum(a1, a2) {
let result = 0
for (let i = 0; i < a1.length; i++) {
result += a1[i] + a2[i]
}
return result
}