You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -694,6 +694,19 @@ var output = myTag`That ${ person } is a ${ age }`;
694
694
console.log(output);
695
695
// That Mike is a youngster
696
696
```
697
+
### `for-of` loop
698
+
`for-of` is a new loop in ES6 that replaces both `for-in` and `forEach()` and supports the new iteration protocol.
699
+
Use it to loop over iterable objects (Arrays, strings, Maps, Sets, etc.):
700
+
```
701
+
const iterable = ['a', 'b'];
702
+
for (const x of iterable) {
703
+
console.log(x);
704
+
}
705
+
706
+
// Output:
707
+
// a
708
+
// b
709
+
```
697
710
### Proxy Object
698
711
The Proxy object is used to define custom behavior for fundamental operations (e.g. property lookup, assignment, enumeration, function invocation, etc). The syntax is:
0 commit comments