JavaScript provides several ways to create loops. Here are some basic types of loops.
When you run this script, you’ll see the following output:
JavaScript provides other looping constructs as well, such as for...of for iterating over iterable objects, and for...in for enumerating object properties. We’ll see some of these forms later when we look at arrays, objects, and other data structures.