I'm having trouble understanding the output. The first two sets of results (func01 1 and func2 01 - func2 05) make sense to me, but everything else is confusing.
As far as I know, after the first iteration of the for loop in func01(), i becomes 2 and then 3 due to func02(), but still, i <= 3 in func01(). It's puzzling to me why there are no func01 2 and func01 3 outputs displayed.
function func02(){
for (i = 1; i <= 5; i++){
document.write(" func02 " + i + "<br>");
}
}
function func01(){
for(i = 1; i <= 3; i++){
document.write("func01 " + i + "<br>");
func02();
}
}
func01();