This is the simplest looping statement provided by JavaScript.

The while loop loops through a block of code as long as the specified condition evaluates to true. As soon as the condition fails, the loop is stopped. The generic syntax of the while loop is:

while(condition) {
    // Code to be executed

The following example defines a loop that will continue to run as long as the variable count is less than 11. The variable count will increase by 1 each time the loop runs:

let count = 1;

while ( count < 11 ) {