Iterating (loops)
Jump to navigation
Jump to search
You can "iterate" to loop over a set of values.
- for
- The for loop is often used to loop over numbers - 0,1,2,3,4,5,6,7,8,9 for example
- foreach
- You use foreach loops to run over the values in an array or a list
- while
- You can use a while loop to keep looping until some condition is achieved