0
the while loop
var x = 1; (x <= ) { document.write(x + "<br />"); x = + 1; } why is it x = x + 1 ???
2 Answers
+ 5
var x = 1;
while (x <= 5) {
document.write(x + "<br>");
x = x + 1;
}
You want to print x's values from 1 to 5 (ie 1 2 3 4 5), so you need to increment x by one each loop.
0
sorry for the late response. thank you I appreciate it!