while Loop in JavaScript
After for loop in JavaScript, the next very common loop in JavaScript is while loop. It is a control flow statement that allows repeated execution of the code based on the given condition. It checks a certain condition to be true and till then repeats the block of code.
The syntax of while loop in JavaScript:
while(condition){
//code
}
where the condition is evaluated before each iteration of the loop. If the condition is true, the code within the loop is executed. Once the code within the loop has finished executed, the condition is evaluated again, and the process continues until the condition is false.
500 Internal Server Error