We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26b34b1 commit e71a4d7Copy full SHA for e71a4d7
page/javascript-101/loops.md
@@ -46,6 +46,18 @@ for (var i = 0, limit = 100; i < limit; i++) {
46
}
47
```
48
49
+## The `for...in` loop
50
+
51
++A `for...in` loop iterates over the properties of an object. For each property, statements can be executed.
52
++
53
++```
54
++for ( prop in obj ) {
55
+ // statements here will be executed for every key in the object
56
+ console.log( prop + ': ' + obj[ prop ] );
57
+}
58
+``
59
60
61
## The `while` loop
62
63
A while loop is similar to an `if` statement, except that its body will keep executing until the condition evaluates to a falsy value.
0 commit comments