var limit = 10;
var total = 0;

for (var i=0; i<=limit; i++) {
  total += i;
}

console.log(total);
var limit = 10;
var total = 0;

for (var i=0; i<=limit; i++) {
  total += i;
  console.log(total)
}

Update index.js