The original code from tutorials point was
var count = 2;document.write("Starting Loop ");
while (count < 200) { document.write("Current Count : " + count + "<br />"); count++; }
document.write("Loop stopped!");
and mine is
var count= 2;document.write("Start counting");
while(count <200)
{ document.write("Current number: "+ count + "<br/>"); count++;}
document.write('stop counting');
the code I wrote gives me a blank page while the original one works just fine, I can’t see what the problem is
and can’t see what’s the difference between these two, can someone please help?
…
Update
Solved!
So, here’s what’s been wrong with my code…not a misspelling, not wrong code
a Comment mark !!
In my editor, there was that comment open symbol below the code and when I removed it, Voilà…problem solved and code worked perfectly.
guys I never knew that was a thing, I mean of course a comment opening will disable a code but when it’s above it…my code wasn’t even commented out!
Anyway, I thought about sharing this with u guys, for a beginner like myself…these things are big deal!