diff options
author | Florian Dieminger <me@fiji-flo.de> | 2021-02-11 18:24:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 18:24:59 +0100 |
commit | 772b3cc462ebbd939d77fbdc35173b7c9bb5670c (patch) | |
tree | a5ccab6bafbf375a8f57bdb406878db630329fe0 /files/ja/web/javascript/guide/loop_statements/continue_statement/index.html | |
parent | aaeeb9abf350ff53bc52223c6a2f6a15d755ae07 (diff) | |
parent | 9368f65a6c94ddbf6bfe9f4f1f27f166b2e2129f (diff) | |
download | translated-content-772b3cc462ebbd939d77fbdc35173b7c9bb5670c.tar.gz translated-content-772b3cc462ebbd939d77fbdc35173b7c9bb5670c.tar.bz2 translated-content-772b3cc462ebbd939d77fbdc35173b7c9bb5670c.zip |
Merge pull request #30 from fiji-flo/unslugging-ja
Unslugging ja
Diffstat (limited to 'files/ja/web/javascript/guide/loop_statements/continue_statement/index.html')
-rw-r--r-- | files/ja/web/javascript/guide/loop_statements/continue_statement/index.html | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/files/ja/web/javascript/guide/loop_statements/continue_statement/index.html b/files/ja/web/javascript/guide/loop_statements/continue_statement/index.html deleted file mode 100644 index f7a5697eeb..0000000000 --- a/files/ja/web/javascript/guide/loop_statements/continue_statement/index.html +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: continue 文 -slug: Web/JavaScript/Guide/Loop_Statements/continue_Statement ---- -<h3 id="continue_.E6.96.87" name="continue_.E6.96.87">continue 文</h3> -<p><code>continue</code> 文は <code>while</code> 文、<code>do-while</code> 文、<code>for</code> 文、<code>label</code> 文をリスタートさせるために用います。</p> -<ul> - <li>ラベルを用いずに <code>continue</code> を使用した場合、現在繰り返している最も内側にある <code>while</code> 文 <code>do-while</code> 文、<code>for</code> 文を終了し、次の反復の実行に移ります。<code>break</code> 文とは異なり、<code>continue</code> はループ全体の実行を終了しません。<code>while</code> ループでは条件比較部分に戻ります。<code>for</code> ループではインクリメントの式に移ります。</li> - <li>ラベルを用いて <code>continue</code> を使用した場合、<code>label</code> で指定されたループ文に移ります。</li> -</ul> -<p><code>continue</code> 文は次のように使用します。</p> -<ol> - <li><code>continue</code></li> - <li><code>continue label</code></li> -</ol> -<p><strong>例 1</strong><br> - 次の例では、<code>i</code> の値が 3 のときに実行される <code>continue</code> 文を用いた <code>while</code> ループを示します。こうすることで <code>n</code> は順に 1、3、7、12 という値をとります。</p> -<pre class="eval">i = 0; -n = 0; -while (i < 5) { - i++; - if (i == 3) - continue; - n += i; -} -</pre> -<p><strong>例 2</strong><br> - <code>checkiandj</code> というラベルの付いた文の中に <code>checkj</code> というラベルの付いた文があります。<code>continue</code> に出くわすと、プログラムは <code>checkj</code> の現在の反復を終了し、次の反復を始めます。<code>continue</code> に出くわすたびに、条件が false になるまで <code>checkj</code> を繰り返します。false が返されると <code>checkiandj</code> 文の残りを完了し、条件が false を返すまで <code>checkiandj</code> を繰り返します。false が返されると <code>checkiandj</code> に続く文が実行されます。</p> -<p><code>continue</code> が <code>checkiandj</code> というラベルを持っているとプログラムは <code>checkiandj</code> 文の最初から続けます。</p> -<pre>checkiandj : - while (i < 4) { - document.write(i + "<br/>"); - i += 1; - checkj : - while (j > 4) { - document.write(j + "<br/>"); - j -= 1; - if ((j % 2) == 0) - continue checkj; - document.write(j + " is odd.<br/>"); - } - document.write("i = " + i + "<br/>"); - document.write("j = " + j + "<br/>"); - } -</pre> -<p>{{ PreviousNext("JavaScript/Guide/Loop_Statements/break_Statement", "JavaScript/Guide/Object_Manipulation_Statements") }}</p> |