I'm using regular function give me correct output when I convert it to arrow function give me error /////////////////////////working prefect////////////////////
function sum() {
total = 0
for (i in arguments) {
total += arguments[i]
}
console.log(total);
}
sum(20, 80, 90, 70);
output = 260
/////////////not working prefect using arrow function/////////////
var sum = () => {
total = 0
for (i in arguments) {
total += arguments[i]
}
console.log(total);
}
sum(20, 80, 90, 70);
Error
0[object Object]function require(path) {
return mod.require(path);
}[object Object]c: