Iterate through an array with for loop - where does it say to print total = x?

I understand how this function works, but what I don’t understand is where in the code does it say to print total = x to the console. I know that from this function total = 20. Shouldn’t total be called or something, though? Or at the very least just print “20” instead of “total = 20” because no where in the code does it actually say to print “total = x” where x is the number that the function results to when it’s done iterating.

var myArr = [ 2, 3, 4, 5, 6];
var total = 0;

for (var i = 0; i < myArr.length; i++) {
  total += myArr[i]; // does this tell the computer to print to console?