# While Loop
While Loops repetitively execute a block of code as long as a specified condition is true.
```javascript
while(condition){
The Do/While Loop is a variant of the while loop. This loop will execute the code block once before checking if the condition is true. It then repeats the loop as long as the condition is true:
// code block to be executed
} while (condition);
Using a while-loop, create a variable named `message` that equals the concatenation of integers (0, 1, 2, ...) as long as its length (`message.length`) is less than 100.
while (message.length < 100) {
while (message2.length < 100) {
# While Loop
While Loops repetitively execute a block of code as long as a specified condition is true.
```javascript
while(condition){
The Do/While Loop is a variant of the while loop. This loop will execute the code block once before checking if the condition is true. It then repeats the loop as long as the condition is true:
// code block to be executed
} while (condition);
Using a while-loop, create a variable named `message` that equals the concatenation of integers (0, 1, 2, ...) as long as its length (`message.length`) is less than 100.
while (message.length < 100) {
while (message2.length < 100) {
/**
* While.java
*
* Represents a while do statement in the While language.
public class While extends Statement {
/**
* The statement to execute while the condition is true.
/**
* Create a new While loop.
/**
* @return the condition of the while statement.
/**
* @return the statement to execute while the condition is true.
@Override
public <T> T accept(WhileVisitor<T> visitor) throws WamException {
% while loops
Rust also has a `while` loop. It looks like this:
while !done {
`while` loops are the correct choice when you’re not sure how many times
Rust’s control-flow analysis treats this construct differently than a `while
Let’s take a look at that `while` loop we had earlier:
while !done {
Both `continue` and `break` are valid in both `while` loops and [`for` loops][for].