Of ﯼﺍﺮﺑ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ


فهرست مطالب

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


for ﻪﻘﻠﺣ

for of

ﺪﯿﻧﺰﺑ ﻪﻘﻠﺣ ﺍﺭ ﻩﺪﻧﻮﺷ ﺭﺍﺮﮑﺗ ﻩﺩﺍﺩ ﯼﺎﻫﺭﺎﺘﺧﺎﺳ ﺎﺗ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ ﻦﯾﺍ

ﻮﺤﻧ

for (variable of iterable) {
  // code block to be executed
}

ﺮﯿﻐﺘﻣ - ﺖﺳﺍ ﯼﺪﻌﺑ ﯽﮔﮋﯾﻭ ﺭﺍﺪﻘﻣ ﺭﺍﺮﮑﺗ ﺮﻫ ﯼﺍﺮﺑ

iterable - ﺖﺳﺍ ﺮﯾﺬﭘﺭﺍﺮﮑﺗ ﯼﺎﻬﯿﮔﮋﯾﻭ ﯼﺍﺭﺍﺩ ﻪﮐ ﯽﺌﯿﺷ.


ﺮﮔﺭﻭﺮﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ

For/of ﺪﺷ ﻪﻓﺎﺿﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻪﺑ 2015 ﻝﺎﺳ ﺭﺩ (ES6)

Safari 7 ﺩﺮﮐ ﯽﻧﺎﺒﯿﺘﺸﭘ ﺮﯾﺯ ﺩﺭﺍﻮﻣ ﺯﺍ ﻪﮐ ﺩﻮﺑ ﯼﺮﮔﺭﻭﺮﻣ ﻦﯿﻟﻭﺍ:

Chrome 38 Edge 12 Firefox 51 Safari 7 Opera 25
Oct 2014 Jul 2015 Oct 2016 Oct 2013 Oct 2014

ﺯﺍ/ﯼﺍﺮﺑ ﯽﻤﻧ ﯽﻧﺎﺒﯿﺘﺸﭘ ﺭﺭﻮﻠﭙﺴﮐﺍ ﺖﻧﺮﺘﻨﯾﺍ ﺭﺩﺩﻮﺷ.


ﻪﯾﺍﺭﺁ ﮏﯾ ﯼﻭﺭ ﻥﺩﺯ ﻪﻘﻠﺣ

ﻝﺎﺜﻣ

const cars = ["BMW", "Volvo", "Mini"];

let text = "";
for (let x of cars) {
  text += x;
}

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript For Of Loop</h2>
<p>The for of statement loops through the values of any iterable object:</p>

<p id="demo"></p>

<script>
const cars = ["BMW", "Volvo", "Mini"];

let text = "";
for (let x of cars) {
  text += x + "<br>";
}

document.getElementById("demo").innerHTML = text;
</script>

</body>
</html>

ﻪﺘﺷﺭ ﮏﯾ ﯼﻭﺭ ﻥﺩﺯ ﻪﻘﻠﺣ

ﻝﺎﺜﻣ

let language = "JavaScript";

let text = "";
for (let x of language) {
  text += x;
}

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript For Of Loop</h2>

<p>The for of statement loops through the values of an iterable object.</p>

<p id="demo"></p>

<script>
let language = "JavaScript";

let text = "";
for (let x of language) {
  text += x + "<br>";
}

document.getElementById("demo").innerHTML = text;
</script>

</body>
</html>

while ﻪﻘﻠﺣ

.ﺖﺳﺍ ﻩﺪﺷ ﻩﺩﺍﺩ ﺢﯿﺿﻮﺗ ﯼﺪﻌﺑ ﻞﺼﻓ ﺭﺩ do/while ﻪﻘﻠﺣ ﻭ