回答編集履歴

1

調整

2025/06/12 03:39

投稿

yambejp
yambejp

スコア117780

test CHANGED
@@ -12,3 +12,17 @@
12
12
  }
13
13
  </script>
14
14
  ```
15
+
16
+ あとは姑息ですがすべて非同期で処理するとか
17
+ ```html
18
+ <script>
19
+ const max_i=2;
20
+ const max_j=2;
21
+ for(let i=0; i<max_i;i++){
22
+ setTimeout(()=>console.log(`親ループ:${i}`),i*max_j*1000);
23
+ for(let j=0; j<max_j;j++){
24
+ setTimeout(()=>console.log(`子ループ:${i}+${j}`),(i*max_j+j+1)*1000);
25
+ }
26
+ }
27
+ </script>
28
+ ```