please help why is my code is not working?
helper.js
export const getTotal = (arr) => {
let sum = 0;
for(let a of arr){
sum += a;
return sum;
}
}
solution.js
import { getTotal } from './helper.js';
const revenue = [10, 10, 20, 55, 1, 5, 12, 15];
console.log(`For the array ${revenue}, total is ${getTotal(revenue)}`);