I don’t know why my code isn’t working

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!

what difference are you seeing?

do you have errors or something?

the code I wrote gives me a blank page while the original one works just fine , I can’t see what the problem is

It looks good on my end, I pasted your code into codepen, and it seems to run fine as it prints off the expected results.

1 Like

Thanks a lot that helped me really ! :slight_smile:

1 Like

NP! Glad you got it to work,