Dart do-while Loop
Dart do-while Loop
In this tutorial, we will learn about the Dart do-while loop, which is a post-test loop. In the post-test loop, the condition is tested after entering the loop.
The do-while loop is similar to the while loop but the only difference is that it executes the loop statements and then evaluates the given loop condition. The while loop is a pre-test loop, the loop condition is tested before entering the loop.
The do-while loop executes the loop body at least once irrespective of whether the loop condition is true or false. On the other hand, a while loop may or may not execute the loop body depending on the given loop condition(s).
Syntax
The general syntax of the do-while loop is as follows:
do { // loop statements } while(condition);
—
Dart Tutorials
Dart tutorial on this website can be found at:
https://www.testingdocs.com/dart-tutorials-for-beginners/
More information on Dart: