In this movie, I want to step aside for just a minute from JavaScript to talk about dry code. And how dry code applies to JavaScript. Dry code is a good thing is something you want to try to do when you're coding DRI stands for don't repeat yourself. So when we're talking about dry code, we want to write code where we're not repeating ourselves while loops. The control structure of loops is something that we have as a tool to help us write dry code. There are additional things in JavaScript that will allow us to do that, for example, functions, but we've just encountered loops and so I wanted to bring up this concept.
So if you are writing a program and you find that you're repeating yourself, well stop for a minute. Maybe there's a better way to do that. Maybe there isn't. Maybe it needs to be like Like it is. And JavaScript is flexible. You can accomplish things in multiple different ways.
But it's good to stop and think about what you're doing. Because there may be a better way to do that. You may be able to use a loop or use some other sort of control structure so that your code becomes much more maintainable. This is part of becoming a modern JavaScript developer is making sure that you ask ask those questions. So keep the concept of dry in your mind as you work on your projects. Alright, let's now do some exercises for loops.