Introduction

You have to print 100 copies of a document. Imagine having to print each copy individually and pressing print 100 times. It’s a lot more efficient and easier to just tell the printer to print the 100 copies and press print once.

The printer is performing an operation (printing a document) repeatedly in a loop until it reaches its goal (100 copies).

In computer programming, we sometimes come across scenarios where a block of code needs to be executed multiple times.

Dart provides for loops for this exact purpose.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy