Thanks niche,
so I suppose is always fundamental to define a variable as a string or as a number (var number = 0 or var text="").
I still have to understand how the loop works and the importance of the variable 'text' for the code itself.
I tried to delete the '+' from the code, and use text = ... instead of: text += "The number is " + i + "<br>";
and the result is only the last line, 'The number is 4'.
So I do not understand what text = text + "The number is " + i + "<br>"; means inside the loop, if one should explain it in words.
Taken for granted that understand "The number is " + i + "<br>", I suppose is just the code text = text + ... that prints out all the results of the loop. What happens there?
For instance, for i=0 we should have: text = text + The number is 0...
So what does 'text' represent?
I am sorry if the question looks so banal, but I am really stuck in this loop