Posts by Lizzie Marques • 41 points
1 post
-
4
votes1
answer220
viewsQ: How to add 1 to the number using the "for" command when the number N is a function parameter?
Being n the value of 5, adding up 1 + 2 + 3 + 4 + 5, resulting in the return. I tried to do it like this, but it didn’t work: function (n){ for ( var i = 0; i < n.length; i++ ){ total += n[i]; }…