0
I need help please!!!. I tried the summary calculator and there is a "undefined" between the outpout , how to remove it?
function Add(...num){ var sum = 0; for(l=0; l<num.length; l++){ sum = sum + num[l]; } console.log(sum) } console.log(Add(1,2,3)); console.log(Add(4,14,5,9,14)); console.log(Add(2,36));
4 Respostas
+ 4
return sum
+ 1
Instead of writing console.log(sum)
Write
return sum
It means whenever u call Add function
sum will return
+ 1
Thank you everyone , i just solved it after i posted this 😅😅😅
0
Hey, could you paste that into a code bit and link it here?
Makes it easier for all of us thank you ^^