回答編集履歴
2
typo
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
jsでいうとpromiseやasn
|
5
|
+
jsでいうとpromiseやasync/await処理です
|
6
6
|
|
7
7
|
|
8
8
|
|
1
chousei
test
CHANGED
@@ -3,3 +3,31 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
jsでいうとpromiseやasnyc/await処理です
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
# sample
|
10
|
+
|
11
|
+
```javascript
|
12
|
+
|
13
|
+
(async()=>{
|
14
|
+
|
15
|
+
for(let i=0;i<10;i++){
|
16
|
+
|
17
|
+
await new Promise(resolve=>{
|
18
|
+
|
19
|
+
setTimeout(()=>{
|
20
|
+
|
21
|
+
console.log(i);
|
22
|
+
|
23
|
+
resolve();
|
24
|
+
|
25
|
+
},300);
|
26
|
+
|
27
|
+
});
|
28
|
+
|
29
|
+
}
|
30
|
+
|
31
|
+
})();
|
32
|
+
|
33
|
+
```
|