0
I’m trying to figure something out, but I can’t. It has a function that takes a parameter, this parameter has a number and is basically to sum from 1 to the number of this parameter in sequence. As in 1 + 2 + 3 + 4... and return the result of the sum of these numbers.
I’m trying to solve it this way:
function somatotal(numero) {
for (var cont = 0; cont < numero; cont++) {
var resultado = cont + 1
return resultado
}
}
But it’s not giving.
hi, I fixed what you pointed out and it worked, thank you!
– MaioAmarelo
@Maioamarelo do not forget to accept the answer as chosen if the answer has helped you.
– Sorack