It will execute as long as the condition is true. It initially checks the given condition then executes the statements that are inside the while loop. The while loop is mostly used to create an infinite loop.
Read moreWhat is for loop in Dart?
The for loop is an implementation of a definite loop . The for loop executes the code block for a specified number of times. It can be used to iterate over a fixed set of values, such as an array.
Read more