Why is += used in this while loop?

Yup, just think of that line as

msg = msg + i + ' x 5 = ' + (i * 5) + '<br/>';

with msg on the RHS being the updated value everytime that line executes

Leave a Comment