回答編集履歴
3
追加
test
CHANGED
@@ -97,3 +97,27 @@
|
|
97
97
|
console.log(value.find(x=>x==="lemon"))
|
98
98
|
|
99
99
|
```
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
---
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
そのまま`for of` (ターゲットをES6、または`--downlevelIteration`オプション)
|
110
|
+
|
111
|
+
```typescript
|
112
|
+
|
113
|
+
let value = map.values()
|
114
|
+
|
115
|
+
for(let x of value){
|
116
|
+
|
117
|
+
console.log(x)
|
118
|
+
|
119
|
+
break;
|
120
|
+
|
121
|
+
}
|
122
|
+
|
123
|
+
```
|
2
修正
test
CHANGED
@@ -94,14 +94,6 @@
|
|
94
94
|
|
95
95
|
let value = Array.from(map.values());
|
96
96
|
|
97
|
-
|
98
|
-
|
99
|
-
for(let x of value){
|
100
|
-
|
101
|
-
|
97
|
+
console.log(value.find(x=>x==="lemon"))
|
102
|
-
|
103
|
-
break;
|
104
|
-
|
105
|
-
}
|
106
98
|
|
107
99
|
```
|
1
追加
test
CHANGED
@@ -53,3 +53,55 @@
|
|
53
53
|
*/
|
54
54
|
|
55
55
|
```
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
---
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
`Array`にして`for of`
|
64
|
+
|
65
|
+
```typescript
|
66
|
+
|
67
|
+
let value = Array.from(map.values());
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
for(let x of value){
|
72
|
+
|
73
|
+
console.log(x)
|
74
|
+
|
75
|
+
break;
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
```
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
---
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
`Array`にして`find()`
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
```typescript
|
94
|
+
|
95
|
+
let value = Array.from(map.values());
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
for(let x of value){
|
100
|
+
|
101
|
+
console.log(x)
|
102
|
+
|
103
|
+
break;
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
```
|