ﺪﯿﻫﺩ ﻪﻣﺍﺩﺍ ﻭ ﻪﺘﺴﮑﺷ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ


فهرست مطالب

    نمایش فهرست مطالب


."ﺪﻧﺯﯽﻣ ﻥﻭﺮﯿﺑ" ﻪﻘﻠﺣ ﮏﯾ ﺯﺍ break ﺕﺭﺎﺒﻋ

ﺭﺩ ﺭﺍﺮﮑﺗ ﮏﯾ "ﯼﻭﺭ ﺯﺍ ﺵﺮﭘ" continue ﺕﺭﺎﺒﻋ


break ﻪﯿﻧﺎﯿﺑ

.ﺪﯾﺍ ﻩﺪﯾﺩ ﺍﺭ ﯽﻠﺒﻗ ﮏﯾ ﺭﺩ ﻩﺩﺎﻔﺘﺳﺍ ﺩﺭﻮﻣ 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 ﺕﺭﺎﺒ

:ﺪﻨﮐ ﯽﻣ ﺮﻈﻧ ﻑﺮﺻ 3 ﺭﺍﺪﻘﻣ ﺯﺍ ﻝﺎﺜﻣ ﻦﯾﺍ

ﻝﺎﺜﻣ

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<

ﺩﺮﮐ ﻩﺩﺎﻔﺘﺳﺍ ﻥﻭﺮﯿﺑ ﻪﺑ ﺵﺮﭘ ﯼﺍﺮﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ 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>

.ﺖﺳﺍ { ﻭ } ﻦﯿﺑ ﺪﮐ ﺯﺍ ﯽﮐﻮﻠﺑ ﺪﮐ ﮎﻮﻠﺑ



تمامی حقوق محفوظ است. © BasicIT.org • 2023-2024