while (i < 10) {
                                            text += "The number is " + i;
                                            i++;
                                        }
                                        

T he while statement creates a loop that is executed while a specified condition is true. The loop will continue to run as long as the condition is true. It will only stop when the condition becomes false. JavaScript supports different kinds of loops: for - loops through a block of code a number of times.