Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

For loop sum in javascript

let sum = 0;
for (let i = 1; i <= 6; i++) {
    sum = sum + i;
}
console.log(sum)
//Output: 21
 
PREVIOUS NEXT
Tagged: #For #loop #sum #javascript
ADD COMMENT
Topic
Name
8+4 =