← Winnitude! Search  ·  Reader Mode (1867 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 115 LINKS

Loops: while and for by mahdiHash · Pull Request #103 · javascript-tutorial/fa.javascript.info

Repository navigation

Loops: while and for - #103


Merged
mahdyar merged 24 commits into javascript-tutorial:master from mahdiHash:master Mar 30, 2021
Merged

Loops: while and for #103 mahdyar merged 24 commits into javascript-tutorial:master from mahdiHash:master

Conversation

mahdiHash commented Mar 30, 2021



Copy link Copy Markdown
Contributor

Please read the description of task 7 "list primes"
Translation of "article.md" was a little tricky and some parts of translation may be weird so please review and comment / commit if you have anything better in mind

mahdiHash added 23 commits March 28, 2021 14:27 Fix typos 665e392
line 11: `i++` -> `++i`  because it is `پیشوند`

line 18: `++i` -> `i++`  because it is `پسوند`
Translate solution.md of " 2-which-value-while" 8e5707f
Please review and comment / commit if anything is wrong
Translate task.md of "3-which-value-for" c998f25
Please review and comment / commit if anything is wrong
Translate task.md of "3-which-value-for" fc9698a
Please review and comment / commit if anything is wrong
Translate solution.md of "3-which-value-for" 8eb82e7
Please review and comment / commit if anything is wrong
Translate task.md of "4-for-even" b61cbbe
Please review and comment / commit if anything is wrong
Translate solution.md of "4-for-even" 7930ad0
Please review and comment / commit if anything is wrong
Translate task.md of "5-replace-for-while" 77fc525
Please review and comment / commit if anything is wrong
Translate solution.md of "5-replace-for-while" 2a417e3 Translate task.md of "6-repeat-until-correct" 979c031
Please review and comment / commit if anything is wrong
Translate solution.md of "6-repeat-until-correct" 5794364
Please review and comment / commit if anything is wrong
Translate task.md (read description) 478e29c
I'm not sure of line 17 translation.
Please review and comment / commit if it could be better or anything is wrong
Translate first part of article.md 2d7c860 Merge pull request #1 from javascript-tutorial/master 4b3fcf6
Update my forked repo
Change a word d702bed
Changed `می شود` to `شده` for reading purposes.
Translate second part of article.md a4dca95 Translate third part of article.md fafbb9a Translate forth part of article.md d091837 Translate 5th part of article.md 0261a80 Translate 6th part of article.md b0d6e90 Translate article.md ed966a3
The translation was a little tricky so please review and comment / commit if anything is wrong.
Change a word bef5760
Changed "میشود" to "می شود"
Change two words 70c8c9e
Changed "میشود" to "می شود"
javascript-translate-bot added the review needed label Mar 30, 2021 javascript-translate-bot requested a review from a team March 30, 2021 15:06 javascript-translate-bot mentioned this pull request Mar 30, 2021 Persian (Farsi) Translation Progress #1 Open mahdyar requested changes Mar 30, 2021
View reviewed changes
Comment thread 1-js/02-first-steps/13-while-for/article.md
Outdated
```

While the `condition` is truthy , the `code` from the loop body is executed.
تا وقتی که `condition` برابر با truthy باشد، `کد` قسمت بدنه حلقه اجرا می شود.
Comment thread 1-js/02-first-steps/13-while-for/article.md
Outdated
تا وقتی که `condition` برابر با truthy باشد، `کد` قسمت بدنه حلقه اجرا می شود.

For instance, the loop below outputs `i` while `i < 3`:
برای مثال، حلقه پایین `i` را نمایش می دهد تا وقتی که `i < 3`:
Comment thread 1-js/02-first-steps/13-while-for/article.md
Outdated
```

Let's learn the meaning of these parts by example. The loop below runs `alert(i)` for `i` from `0` up to (but not including) `3` :
بیایید معنی این قسمت ها را با مثال یاد بگیریم. حلقه زیر `alert(i)` را برای هر `i` از `0` تا `3` (اما شامل نمی شود) اجرا می کند :
Comment thread 1-js/02-first-steps/13-while-for/article.md
Outdated
```

Let's examine the `for` statement part-by-part :
بیایید دستور `for` را قسمت به قسمت بازرسی کنیم :
Comment thread 1-js/02-first-steps/13-while-for/article.md
Outdated
یعنی اینکه، `begin` یک بار اجرا می شود، و سپس این تکرار می شود: بعد از هر بار آزمایش `condition` ، `body` و `step` اجرا می شوند.

If you are new to loops, it could help to go back to the example and reproduce how it runs step-by-step on a piece of paper .
اگر شما در حلقه ها تازه وارد هستید، این می تواند کمک کند که به مثال برگردید و چگونگی اجرا شدن آن را مرحله به مرحله روی یک کاغذ بنویسید .
Comment thread 1-js/02-first-steps/13-while-for/article.md
Outdated
```

This makes the loop identical to `while (i < 3)`.
این کار حلقه را شبیه `while (i < 3)` می کند .
Comment thread 1-js/02-first-steps/13-while-for/article.md
Outdated
```

Please note that the two `for` semicolons `;` must be present. Otherwise, there would be a syntax error .
لطفا در نظر داشته باشید که هر دو نقطه ویرگول `;` داخل `for` باید وجود داشته باشند. در غیر این صورت، یک ارور سینتکس به وجود خواهد آمد .
Comment thread 1-js/02-first-steps/13-while-for/article.md
Outdated
لطفا در نظر داشته باشید که هر دو نقطه ویرگول `;` داخل `for` باید وجود داشته باشند. در غیر این صورت، یک ارور سینتکس به وجود خواهد آمد .

## Breaking the loop
## شکستن حلقه
Comment thread 1-js/02-first-steps/13-while-for/article.md
Outdated
اما ما می توانیم با استفاده از دستور خاص `break` آن را در هر لحظه مجبور به توقف کنیم .

For example, the loop below asks the user for a series of numbers, "breaking" when no number is entered :
برای مثال، حلقه زیر از کاربر یک سری عدد درخواست می کند، و زمانی که هیچ عددی وارد نشد "می شکند" :
Comment thread 1-js/02-first-steps/13-while-for/article.md
Outdated
```

... it stops working: there's a syntax error .
... متوقف می شود: چون یک ارور سینتکس وجود دارد .
javascript-translate-bot removed the review needed label Mar 30, 2021

javascript-translate-bot commented Mar 30, 2021



Copy link Copy Markdown

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

javascript-translate-bot added the changes requested label Mar 30, 2021 Fix mentioned problems and change some lines d421e8e
All the mentioned problems are fixed and I also changed some lines to make it more readable

mahdiHash commented Mar 30, 2021



Copy link Copy Markdown
Contributor

Author

Thank you @mahdyar for your review

mahdiHash commented Mar 30, 2021



Copy link Copy Markdown
Contributor

Author

/done

javascript-translate-bot added review needed and removed changes requested labels Mar 30, 2021 javascript-translate-bot requested a review from a team March 30, 2021 17:34 mahdyar approved these changes Mar 30, 2021
View reviewed changes
javascript-translate-bot added needs +1 and removed review needed labels Mar 30, 2021 mahdyar merged commit daf19aa into javascript-tutorial : master Mar 30, 2021

javascript-translate-bot commented Mar 30, 2021



Copy link Copy Markdown

Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉

Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

needs +1

3 participants