AJ Zhang8,946 Points
why did it print out all the divs instead of just the last one?
I don't quite understand why it printed all the divs. Shouldn't it just print the last value returned? Thanks.
It prints out all the divs because each time the for loop iterates it adds another <div> containing that "i" value to the array
html. once the loop is complete it then writes out that html array in its entirety.
Hope that helps make sense of it,