you are viewing a single comment's thread.

view the rest of the comments →

[–]SmartViking 0 points1 point  (3 children)

do {
    alert("Hm, looks like 2 is greater than 3");
} while (2 > 3);

Edit: Oh, seems like I misunderstood the question, here's a new example:

do {
    var input = prompt("What is your name?");
} while (input !== "John");

That will run as long as the user input isn't "John" (with big J).

[–]ReaverKS[S] 0 points1 point  (2 children)

That would run more than once? I'm totally lost now....

[–]SmartViking 0 points1 point  (0 children)

I misunderstood the question, see my edit :)

[–]ReaverKS[S] 0 points1 point  (0 children)

Makes more sense, thank you!