for-loops, continued

Learn how to repeat a set of code as many times as you like, without using functions. For-loops are a fundamental part of every programming language. We'll see how to write them and how to use them with arrays.

Refactoring our Code

For-loops are one of the few places with a single letter name is acceptable. Instead of index, it’s common practice to use i or j. Let’s refactor our code from the previous lesson.

Create a free account to access the full course.

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