It's alright, I worked it out with a little help.
If anyone's wondering, the answer is in the following line of code:
p.innerHTML = "i: " + i + "<br>" + p.innerHTML;
I'll explain it with two iterations, in four steps each.
Hopefully I got it right, and explained it in non-nerd well lol.
Step 1. When i = 10, the browser prints the following in the <p> tag:
i: 10 <br>
Step 2. p.innerHTML (right of the = operator) is empty for now, hence, nothing happens on the screen in this step.
Step 3. The printed line (i: 10 <br>