-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfor.html
40 lines (34 loc) · 923 Bytes
/
for.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>For</title>
</head>
<body>
<h3>For in/of</h3>
<ul>
<li>for/in for objects properties/methods</li>
<ul>
<li>iterates over elements of object (properties and methods)</li>
<li>returns key names of property/method</li>
<li>can use as `object[key] / object.key` to access value</li>
</ul>
<li>fot/of for iterable objects</li>
<ul>
<li>
iterates over arrays, string etc
</li>
<li>returns object for each iteration</li>
</ul>
<li>Break: leave a loop early</li>
<li>Continue: next iteration of a loop by passing any code below</li>
<li>
Labeled Statement: Not recommended for use* define a location to "goto"
</li>
</ul>
<script>
"use strict";
</script>
</body>
</html>