Loops: while and for#103
Loops: while and for#103mahdyar merged 24 commits intojavascript-tutorial:masterfrom mahdiHash:master
Conversation
Please review and comment / commit if anything is wrong
Please review and comment / commit if anything is wrong
Please review and comment / commit if anything is wrong
Please review and comment / commit if anything is wrong
Please review and comment / commit if anything is wrong
Please review and comment / commit if anything is wrong
Please review and comment / commit if anything is wrong
Please review and comment / commit if anything is wrong
Please review and comment / commit if anything is wrong
I'm not sure of line 17 translation. Please review and comment / commit if it could be better or anything is wrong
Update my forked repo
Changed `می شود` to `شده` for reading purposes.
The translation was a little tricky so please review and comment / commit if anything is wrong.
Changed "میشود" to "می شود"
Changed "میشود" to "می شود"
| ``` | ||
|
|
||
| While the `condition` is truthy, the `code` from the loop body is executed. | ||
| تا وقتی که `condition` برابر با truthy باشد، `کد` قسمت بدنه حلقه اجرا می شود. |
| تا وقتی که `condition` برابر با truthy باشد، `کد` قسمت بدنه حلقه اجرا می شود. | ||
|
|
||
| For instance, the loop below outputs `i` while `i < 3`: | ||
| برای مثال، حلقه پایین `i` را نمایش می دهد تا وقتی که `i < 3`: |
There was a problem hiding this comment.
In Persian verb comes at the end, so It would be a better translation:
برای مثال، حلقه پایین `i` را تا وقتی که `i < 3` باشد، نمایش میدهد:
| ``` | ||
|
|
||
| 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` (اما شامل نمی شود) اجرا می کند: |
| ``` | ||
|
|
||
| Let's examine the `for` statement part-by-part: | ||
| بیایید دستور `for` را قسمت به قسمت بازرسی کنیم: |
There was a problem hiding this comment.
"Statement" doesn't mean دستور, using شرح would be a better idea.
There was a problem hiding this comment.
Also using 'بررسی' instead of 'بازرسی' would be a better idea.
| یعنی اینکه، `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. | ||
| اگر شما در حلقه ها تازه وارد هستید، این می تواند کمک کند که به مثال برگردید و چگونگی اجرا شدن آن را مرحله به مرحله روی یک کاغذ بنویسید. |
There was a problem hiding this comment.
Don't translate literally, see what would look more natural in Persian, even if it's not the same words in English:
اگر تازه با حلقهها آشنا شده اید، به مثال برگردید و بر روی یک تکه کاغذ مراحل اجرای آن را قدم به قدم بازتولید کنید.
| ``` | ||
|
|
||
| This makes the loop identical to `while (i < 3)`. | ||
| این کار حلقه را شبیه `while (i < 3)` می کند. |
| ``` | ||
|
|
||
| Please note that the two `for` semicolons `;` must be present. Otherwise, there would be a syntax error. | ||
| لطفا در نظر داشته باشید که هر دو نقطه ویرگول `;` داخل `for` باید وجود داشته باشند. در غیر این صورت، یک ارور سینتکس به وجود خواهد آمد. |
| لطفا در نظر داشته باشید که هر دو نقطه ویرگول `;` داخل `for` باید وجود داشته باشند. در غیر این صورت، یک ارور سینتکس به وجود خواهد آمد. | ||
|
|
||
| ## Breaking the loop | ||
| ## شکستن حلقه |
| اما ما می توانیم با استفاده از دستور خاص `break` آن را در هر لحظه مجبور به توقف کنیم. | ||
|
|
||
| For example, the loop below asks the user for a series of numbers, "breaking" when no number is entered: | ||
| برای مثال، حلقه زیر از کاربر یک سری عدد درخواست می کند، و زمانی که هیچ عددی وارد نشد "می شکند": |
| ``` | ||
|
|
||
| ...it stops working: there's a syntax error. | ||
| ...متوقف می شود: چون یک ارور سینتکس وجود دارد. |
|
Please make the requested changes. After it, add a comment "/done". |
All the mentioned problems are fixed and I also changed some lines to make it more readable
|
Thank you @mahdyar for your review |
|
/done |
|
Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉 |
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