for
ﻪﻘﻠﺣ ﺪﯿﻧﺰﺑ ﻪﻘﻠﺣ ﺍﺭ ﻩﺪﻧﻮﺷ ﺭﺍﺮﮑﺗ ﻩﺩﺍﺩ ﯼﺎﻫﺭﺎﺘﺧﺎﺳ ﺎﺗ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ ﻦﯾﺍ ﺮﯿﻐﺘﻣ - ﺖﺳﺍ ﯼﺪﻌﺑ ﯽﮔﮋﯾﻭ ﺭﺍﺪﻘﻣ ﺭﺍﺮﮑﺗ ﺮﻫ ﯼﺍﺮﺑ iterable - ﺖﺳﺍ ﺮﯾﺬﭘﺭﺍﺮﮑﺗ ﯼﺎﻬﯿﮔﮋﯾﻭ ﯼﺍﺭﺍﺩ ﻪﮐ ﯽﺌﯿﺷ. For/of ﺪﺷ ﻪﻓﺎﺿﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻪﺑ 2015 ﻝﺎﺳ ﺭﺩ (ES6) Safari 7 ﺩﺮﮐ ﯽﻧﺎﺒﯿﺘﺸﭘ ﺮﯾﺯ ﺩﺭﺍﻮﻣ ﺯﺍ ﻪﮐ ﺩﻮﺑ ﯼﺮﮔﺭﻭﺮﻣ ﻦﯿﻟﻭﺍ: ﺯﺍ/ﯼﺍﺮﺑ ﯽﻤﻧ ﯽﻧﺎﺒﯿﺘﺸﭘ ﺭﺭﻮﻠﭙﺴﮐﺍ ﺖﻧﺮﺘﻨﯾﺍ ﺭﺩﺩﻮﺷ. → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ .ﺖﺳﺍ ﻩﺪﺷ ﻩﺩﺍﺩ ﺢﯿﺿﻮﺗ ﯼﺪﻌﺑ ﻞﺼﻓ ﺭﺩ ﻮﺤﻧ
for (variable of iterable) {
// code block to be executed
}
ﺮﮔﺭﻭﺮﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ
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
ﻪﻘﻠﺣ ﻭ