."ﺪﻧﺯﯽﻣ ﻥﻭﺮﯿﺑ" ﻪﻘﻠﺣ ﮏﯾ ﺯﺍ break
ﺕﺭﺎﺒﻋ
ﺭﺩ ﺭﺍﺮﮑﺗ ﮏﯾ "ﯼﻭﺭ ﺯﺍ ﺵﺮﭘ" continue
ﺕﺭﺎﺒﻋ
break
ﻪﯿﻧﺎﯿﺑ.ﺪﯾﺍ ﻩﺪﯾﺩ ﺍﺭ ﯽﻠﺒﻗ ﮏﯾ ﺭﺩ ﻩﺩﺎﻔﺘﺳﺍ ﺩﺭﻮﻣ break
ﺕﺭﺎﺒﻋ ﻼًﺒﻗ
:ﺩﻮﺷ ﻩﺩﺎﻔﺘﺳﺍ ﻪﻘﻠﺣ ﮏﯾ ﺯﺍ ﺵﺮﭘ ﯼﺍﺮﺑ ﺪﻧﺍﻮﺗ ﯽﻣ ﻦﯿﻨﭽﻤﻫ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ ("ﺪﻫﺩ ﯽﻣ ﺖﺴﮑﺷ" ﺍﺭ ﻪﻘﻠﺣ) ﺪﻫﺩ ﯽﻣ ﻥﺎﯾﺎﭘ ﻪﻘﻠﺣ ﻪﺑ ﻥﺪﺷ ﺺﺨﺸﻣ ﺕﺭﻮﺻ ﺭﺩ ﺍﺭ (ﻪﻘﻠﺣ ﺭﺩ) ﺭﺍﺮﮑﺗ ﮏﯾ :ﺪﻨﮐ ﯽﻣ ﺮﻈﻧ ﻑﺮﺻ 3 ﺭﺍﺪﻘﻣ ﺯﺍ ﻝﺎﺜﻣ ﻦﯾﺍ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ ﺪﯾﺮﯿﮔ ﯽﻣ ﺭﺍﺮﻗ ﺐﺴﭼﺮﺑ ﻡﺎﻧ ﮏﯾ ﺎﺑ ﺕﺍﺭﺎﺒﻋ ﺯﺍ ﻞﺒﻗ ،ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺕﺍﺭﺎﺒﻋ ﯼﺭﺍﺬﮔ ﺐﺴﭼﺮﺑ ﯼﺍﺮﺑ ﻪﮐ ﺪﻨﺘﺴﻫ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺕﺍﺭﺎﺒﻋ ﺎﻬﻨﺗ : ﻮﺤﻧ ﺖﺳﺍ ﻩﺩﺎﻔﺘﺳﺍ ﻞﺑﺎﻗ ﯼﺍﺮﺑ ﻂﻘﻓ ،ﺐﺴﭼﺮﺑ ﻊﺟﺮﻣ ﻥﻭﺪﺑ ، ﺩﺮﮐ ﻩﺩﺎﻔﺘﺳﺍ ﻥﻭﺮﯿﺑ ﻪﺑ ﺵﺮﭘ ﯼﺍﺮﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ break ﺭﻮﺘﺳﺩ ،ﺐﺴﭼﺮﺑ ﻊﺟﺮﻣ ﮏﯾ ﺎﺑ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ .ﺖﺳﺍ { ﻭ } ﻦﯿﺑ ﺪﮐ ﺯﺍ ﯽﮐﻮﻠﺑ ﺪﮐ ﮎﻮﻠﺑbreak
ﻝﺎﺜﻣ
for (let i = 0; i < 10; i++) {
if (i === 3) { break; }
text += "The number is " + i + "<br>";
}
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Loops</h2>
<p>A loop with a <b>break</b> statement.</p>
<p id="demo"></p>
<script>
let text = "";
for (let i = 0; i < 10; i++) {
if (i === 3) { break; }
text += "The number is " + i + "<br>";
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>
break
ﺕ
continue
ﻪﯿﻧﺎﯿﺑcontinue
ﺕﺭﺎﺒ ﻝﺎﺜﻣ
for (let i = 0; i < 10; i++) {
if (i === 3) { continue; }
text += "The number is " + i + "<br>";
}
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Loops</h2>
<p>A loop with a <b>continue</b> statement.</p>
<p>A loop which will skip the step where i = 3.</p>
<p id="demo"></p>
<script>
let text = "";
for (let i = 0; i < 10; i++) {
if (i === 3) { continue; }
text += "The number is " + i + "<br>";
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>
ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯼﺎﻫ ﺐﺴﭼﺮﺑ
label:
statements
continue
ﻭ break labelname;
continue labelname;
ﻪﻣﺍﺩﺍ
break<
ﻝﺎﺜﻣ
const cars = ["BMW", "Volvo", "Saab", "Ford"];
list: {
text += cars[0] + "<br>";
text += cars[1] + "<br>";
break list;
text += cars[2] + "<br>";
text += cars[3] + "<br>";
}
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript break</h2>
<p id="demo"></p>
<script>
const cars = ["BMW", "Volvo", "Saab", "Ford"];
let text = "";
list: {
text += cars[0] + "<br>";
text += cars[1] + "<br>";
break list;
text += cars[2] + "<br>";
text += cars[3] + "<br>";
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>