This video introduces Dart for loops and how they can automate parts of your code. For loops allow you to execute parts of your code multiple times saving you space and time in your project.
that has a value for each of our currencies, … and we know we have a lot of those, … so manually doing this is probably not an option … for us lazy programmers. … But luckily, we have this construct called loops, … in pretty much all programming languages. … and then we have a semicolon, … and we define how long we want our loop to run for. … So while i is less than seven, … we're going to keep running our loop. … And then, after a second semicolon, … we specify how we want i to increase after each loop. … Now finally, inside some curly braces, … we're going to do something seven minus zero times. … So you can look at as if this is the starting value, … and this is the ending value, … and this is how we're going to go from zero to seven. … So we're going to go in increments of one. … So we're going to start out at zero, run our code, … increase by one, then run our code, … then increase by one again, then run our code, … until i is equal to six. … But more than just running code many many times, …
This course was created by London App Brewery. We are pleased to host this content in our library.