Skip to content

Commit 2daedb8

Browse files
committed
closes #3019
1 parent bb6667a commit 2daedb8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

1-js/02-first-steps/13-while-for/article.md

+13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ For example, outputting goods from a list one after another or just running the
66

77
*Loops* are a way to repeat the same code multiple times.
88

9+
```smart header="The for..of and for..in loops"
10+
A small announcement for advanced readers.
11+
12+
This article covers only basic loops: `while`, `do..while` and `for(..;..;..)`.
13+
14+
If you came to this article searching for other types of loops, here are the pointers:
15+
16+
- See [for..in](info:object#forin) to loop over object properties.
17+
- See [for..of](info:array#loops) and [iterables](info:iterable) for looping over arrays and iterable objects.
18+
19+
Otherwise, please read on.
20+
```
21+
922
## The "while" loop
1023

1124
The `while` loop has the following syntax:

1-js/04-object-basics/01-object/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ In the code above, the property `obj.test` technically exists. So the `in` opera
355355
Situations like this happen very rarely, because `undefined` should not be explicitly assigned. We mostly use `null` for "unknown" or "empty" values. So the `in` operator is an exotic guest in the code.
356356
357357
358-
## The "for..in" loop
358+
## The "for..in" loop [#forin]
359359
360360
To walk over all keys of an object, there exists a special form of the loop: `for..in`. This is a completely different thing from the `for(;;)` construct that we studied before.
361361

0 commit comments

Comments
 (0)