Skip to content

Commit 25067f3

Browse files
committed
Fix a part of conflicts
1 parent 247b652 commit 25067f3

6 files changed

Lines changed: 33 additions & 84 deletions

File tree

1-js/02-first-steps/07-type-conversions/article.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ alert(age); // NaN, conversion failed
7272
|`undefined`|`NaN`|
7373
|`null`|`0`|
7474
|<code>true&nbsp;and&nbsp;false</code> | `1` and `0` |
75-
<<<<<<< HEAD
76-
| `string` | فاصله‌های خالی ابتدا و انتها حذف می‌شوند. اگر رشته‌ی باقی مانده خالی باشد نتیجه `0` خواهد بود. در غیر اینصورت عدد موجود در رشته کاراکترها خوانده خواهد شد. همینطور اگر خطایی رخ دهد نتیجه `NaN` خواهد بود. |
77-
=======
78-
| `string` | Whitespaces (includes spaces, tabs `\t`, newlines `\n` etc.) from the start and end are removed. If the remaining string is empty, the result is `0`. Otherwise, the number is "read" from the string. An error gives `NaN`. |
79-
>>>>>>> 1edb0a38330b54d2e1916f5193fc043e6fbbea78
75+
| `string` | فاصله‌های خالی ابتدا و انتها (شامل spaceها، tabها `\t`و خطوط جدید `\n` و دیگر موارد) حذف می‌شوند. اگر رشته‌ی باقی مانده خالی باشد نتیجه `0` خواهد بود. در غیر اینصورت عدد موجود در رشته کاراکترها «خوانده» خواهد شد. اگر خطایی رخ دهد نتیجه `NaN` خواهد بود. |
8076

8177
Examples:
8278

@@ -150,13 +146,9 @@ alert( Boolean(" ") ); // spaces, also true (any non-empty string is true)
150146
|`undefined`|`NaN`|
151147
|`null`|`0`|
152148
|<code>true&nbsp;/&nbsp;false</code> | `1 / 0` |
153-
<<<<<<< HEAD
154-
| `string` | فاصله‌های خالی ابتدا و انتها حذف می‌شوند. اگر رشته‌ی باقی مانده خالی باشد نتیجه `0` خواهد بود. در غیر اینصورت عدد موجود در رشته کاراکترها خوانده خواهد شد. همینطور اگر خطایی رخ دهد نتیجه `NaN` خواهد بود. |
149+
| `string` | رشته همانطور که «هست» خوانده می‌شود و فاصله‌های خالی (شامل spaceها، tabها `\t`، خطوط جدید `\n` و غیره) نادیده گرفته می‌شوند. یک رشته خالی `0` می‌شود. ارور `NaN` را نتیجه می‌دهد. |
155150
156151
**`تبدیل به boolean`** – در عملگرهای منطقی رخ می‌دهد. از طریق `Boolean(value)` قابل انجام است.
157-
=======
158-
| `string` | The string is read "as is", whitespaces (includes spaces, tabs `\t`, newlines `\n` etc.) from both sides are ignored. An empty string becomes `0`. An error gives `NaN`. |
159-
>>>>>>> 1edb0a38330b54d2e1916f5193fc043e6fbbea78
160152
161153
این تبدیل از این قوانین پیروی می‌کند :
162154

1-js/02-first-steps/08-operators/article.md

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -194,32 +194,18 @@ alert( +apples + +oranges ); // 5
194194
| اولویت | نام | علامت |
195195
|------------|------|------|
196196
| ... | ... | ... |
197-
<<<<<<< HEAD
198-
| 15 | جمع یگانه | `+` |
199-
| 15 | تفریق یگانه | `-` |
200-
| 14 | بتوان رساندن | `**` |
201-
| 13 | ضرب | `*` |
202-
| 13 | تقسیم | `/` |
203-
| 12 | جمع | `+` |
204-
| 12 | تفریق | `-` |
205-
=======
206-
| 14 | unary plus | `+` |
207-
| 14 | unary negation | `-` |
208-
| 13 | exponentiation | `**` |
209-
| 12 | multiplication | `*` |
210-
| 12 | division | `/` |
211-
| 11 | addition | `+` |
212-
| 11 | subtraction | `-` |
213-
>>>>>>> 1edb0a38330b54d2e1916f5193fc043e6fbbea78
197+
| 14 | جمع یگانه | `+` |
198+
| 14 | تفریق یگانه | `-` |
199+
| 13 | بتوان رساندن | `**` |
200+
| 12 | ضرب | `*` |
201+
| 12 | تقسیم | `/` |
202+
| 11 | جمع | `+` |
203+
| 11 | تفریق | `-` |
214204
| ... | ... | ... |
215205
| 2 | مقداردهی | `=` |
216206
| ... | ... | ... |
217207

218-
<<<<<<< HEAD
219-
همانطور که می‌بینیم «عملگر + یگانه» اولویت `15` دارد که از عملگر جمع ( + دوگانه) با اولویت `12` بالاتر است. به همین دلیل است که در عبارت `"+apples + +oranges"` عملگرهای + یگانه پیش از علامت جمع اجرا می‌شوند.
220-
=======
221-
As we can see, the "unary plus" has a priority of `14` which is higher than the `11` of "addition" (binary plus). That's why, in the expression `"+apples + +oranges"`, unary pluses work before the addition.
222-
>>>>>>> 1edb0a38330b54d2e1916f5193fc043e6fbbea78
208+
همانطور که می‌بینیم «عملگر + یگانه» اولویت `14` دارد که از عملگر جمع ( + دوگانه) با اولویت `11` بالاتر است. به همین دلیل است که در عبارت `"+apples + +oranges"` عملگرهای + یگانه پیش از علامت جمع اجرا می‌شوند.
223209

224210
## مقداردهی
225211

@@ -317,13 +303,9 @@ alert( n ); // 14
317303
```js run
318304
let n = 2;
319305
320-
n *= 3 + 5; // right part evaluated first, same as n *= 8
306+
n *= 3 + 5; // یکسان است n *= 8 ،قسمت سمت راست اول ارزیابی شد
321307
322-
<<<<<<< HEAD
323-
alert( n ); // 16 (یکسان است n *= 8، قسمت سمت راست اول ارزیابی می‌شود)
324-
=======
325-
alert( n ); // 16
326-
>>>>>>> 1edb0a38330b54d2e1916f5193fc043e6fbbea78
308+
alert( n ); // 16
327309
```
328310

329311
## عملگر افزایش/کاهش

1-js/02-first-steps/12-nullish-coalescing-operator/article.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,7 @@ alert(height ?? 100); // 0
106106
107107
## اولویت
108108
109-
<<<<<<< HEAD
110-
اولویت عملگر `??` برابر با عملگر `||` است. اولویت آن‌ها در [جدول MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table) برابر با `4` است.
111-
=======
112-
The precedence of the `??` operator is the same as `||`. They both equal `3` in the [MDN table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table).
113-
>>>>>>> 1edb0a38330b54d2e1916f5193fc043e6fbbea78
109+
اولویت عملگر `??` برابر با عملگر `||` است. اولویت آن‌ها در [جدول MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table) برابر با `3` است.
114110
115111
این یعنی که درست مانند `||`، عملگر nullish coalescing `??` قبل از `=` و `?` ارزیابی می‌شود، اما بعد از بیشتر عملیات‌ها مانند `+`، `-` ارزیابی می‌شود.
116112

1-js/02-first-steps/15-function-basics/article.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,13 @@ function showMessage(from, *!*text = "no text given"*/!*) {
206206
showMessage("Ann"); // Ann: no text given
207207
```
208208
209-
<<<<<<< HEAD
210209
حالا اگر پارامتر `text` پاس داده نشود، مقدار `"no text given"` را می‌گیرد.
211-
=======
212-
Now if the `text` parameter is not passed, it will get the value `"no text given"`.
213210
214-
The default value also jumps in if the parameter exists, but strictly equals `undefined`, like this:
211+
اگر پارامتر وجود داشته باشد اما برابر با `undefined` باشد، مقدار پیش‌فرض همچنان وارد عمل می‌شود، مثل این:
215212
216213
```js
217214
showMessage("Ann", undefined); // Ann: no text given
218215
```
219-
>>>>>>> 1edb0a38330b54d2e1916f5193fc043e6fbbea78
220216
221217
اینجا `"no text given"` یک رشته است، اما می‌تواند عبارت پیچیده‌تری باشد، که تنها در حالتی ارزیابی و مقداردهی می‌شود که پارامتری وجود نداشته باشد. بنابراین این هم ممکن است:
222218

1-js/04-object-basics/09-object-toprimitive/article.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,8 @@ alert(user + 500); // hint: default -> 1500
137137

138138
اگر `Symbol.toPrimitive` وجود نداشته باشد، سپس جاوااسکریپت سعی می‌کند که متدهای `toString` و `valueOf` را پیدا کند:
139139

140-
<<<<<<< HEAD
141-
- برای جزء "string": `toString` و اگر این متد وجود نداشت، سپس `valueOf` (پس `toString` برای تبدیل‌های رشته‌ای اولویت دارد).
142-
- برای بقیه جزءها: `valueOf` و اگر این متد وجود نداشت، سپس `toString` (پس `valueOf` برای ریاضیات اولویت دارد).
143-
=======
144-
- For the `"string"` hint: call `toString` method, and if it doesn't exist or if it returns an object instead of a primitive value, then call `valueOf` (so `toString` has the priority for string conversions).
145-
- For other hints: call `valueOf`, and if it doesn't exist or if it returns an object instead of a primitive value, then call `toString` (so `valueOf` has the priority for maths).
146-
>>>>>>> 1edb0a38330b54d2e1916f5193fc043e6fbbea78
140+
- برای جزء "string": `toString` و اگر این متد وجود نداشت یا به جای یک مقدار اصلی شیءای را برگرداند، سپس `valueOf` (پس `toString` برای تبدیل‌های رشته‌ای اولویت دارد).
141+
- برای بقیه جزءها: `valueOf` و اگر این متد وجود نداشت یا به جای یک مقدار اصلی شیءای را برگرداند، سپس `toString` (پس `valueOf` برای ریاضیات اولویت دارد).
147142

148143
متدهای `toString` و `valueOf` از زمان‌های گذشته وجود دارند. آن‌ها سمبل نیستند (سمبل‌ها انقدر قدیمی نیستند) بلکه متدهای «معمولی» هستند که اسمی رشته‌ای دارد. آن‌ها راهی جایگزین برای پیاده‌سازی تبدیل به «سبک قدیمی» را فراهم می‌کنند.
149144

1-js/05-data-types/02-number/article.md

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -333,53 +333,46 @@ alert( isFinite(num) );
333333

334334
توجه داشته باشید که رشته حرفی‌ای که در آن فقط یک جای خالی باشد یا کلا خالی باشد، به عنوان صفر در همه‌ی توابع عددی از جمله `isFinite` در نظر گرفته میشود.
335335

336-
<<<<<<< HEAD
337-
```smart header="مقایسه کنید با `Object.is`"
338-
یک متد درون‌ساخت خاص به نام [Object.is](mdn:js/Object/is) وجود دارد که مقادیر را مثل `===` مقایسه میکند، اما برای دو حالت مرزی قابل اعتمادتر است:
339-
=======
340-
````smart header="`Number.isNaN` and `Number.isFinite`"
341-
[Number.isNaN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) and [Number.isFinite](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) methods are the more "strict" versions of `isNaN` and `isFinite` functions. They do not autoconvert their argument into a number, but check if it belongs to the `number` type instead.
336+
````smart header="`Number.isNaN` و `Number.isFinite`"
337+
متدهای [Number.isNaN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) و [Number.isFinite](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) نسخه‌های «سخت‌گیرتر» از تابع‌های `isNaN` و `isFinite` هستند. آن‌ها به طور خودکار آرگومان خود را به عدد تبدیل نمی‌کنند بلکه در عوض بررسی می‌کنند که آیا آرگومان به نوع `number` تعلق دارد یا خیر.
342338

343-
- `Number.isNaN(value)` returns `true` if the argument belongs to the `number` type and it is `NaN`. In any other case it returns `false`.
339+
- `Number.isNaN(value)` اگر آرگومان به نوع `number` تعلق داشته باشد و برابر با `NaN` باشد مقدار `true` را برمی‌گرداند. در غیر این صورت `false` برگردانده می‌شود.
344340

345341
```js run
346342
alert( Number.isNaN(NaN) ); // true
347343
alert( Number.isNaN("str" / 2) ); // true
348344
349-
// Note the difference:
350-
alert( Number.isNaN("str") ); // false, because "str" belongs to the string type, not the number type
345+
// :به تفاوت توجه کنید
346+
alert( Number.isNaN("str") ); // false به نوع رشته تعلق دارد نه عدد پس "str" چون
351347
alert( isNaN("str") ); // true, because isNaN converts string "str" into a number and gets NaN as a result of this conversion
348+
// چون isNaN رشته "str" را به یک عدد تبدیل می‌کند و از این تبدیل NaN را دریافت می‌کند
349+
// true را دریافت می‌کند پس NaN را به یک عدد تبدیل می‌کند و از این تبدیل "str" رشته isNaN چون
352350
```
353351

354-
- `Number.isFinite(value)` returns `true` if the argument belongs to the `number` type and it is not `NaN/Infinity/-Infinity`. In any other case it returns `false`.
352+
- `Number.isFinite(value)` اگر آرگومان به نوع `number` تعلق داشته باشد و `NaN/Infinity/-Infinity` نباشد مقدار `true` برگردانده می‌شود. در غیر این صورت `false` را برمی‌گرداند.
355353

356354
```js run
357355
alert( Number.isFinite(123) ); // true
358356
alert( Number.isFinite(Infinity) ); //false
359357
alert( Number.isFinite(2 / 0) ); // false
360358
361-
// Note the difference:
362-
alert( Number.isFinite("123") ); // false, because "123" belongs to the string type, not the number type
363-
alert( isFinite("123") ); // true, because isFinite converts string "123" into a number 123
359+
// :به تفاوت توجه کنید
360+
alert( Number.isFinite("123") ); // false چون "123" به نوع رشته تعلق دارد نه نوع عدد پس
361+
alert( isFinite("123") ); // true رشته "123" را به عدد 123 تبدیل می‌کند پس isFinite چون
364362
```
365363

366-
In a way, `Number.isNaN` and `Number.isFinite` are simpler and more straightforward than `isNaN` and `isFinite` functions. In practice though, `isNaN` and `isFinite` are mostly used, as they're shorter to write.
364+
به نحوی، `Number.isNaN` و `Number.isFinite` ساده‌تر و سرراست‌تر از تابع‌های `isNaN` و `isFinite` هستند. اگرچه در عمل، `isNaN` و `isFinite` بیشتر استفاده می‌شوند چون برای نوشتن کوتاه‌تر هستند.
367365
````
368366

369-
```smart header="Comparison with `Object.is`"
370-
There is a special built-in method `Object.is` that compares values like `===`, but is more reliable for two edge cases:
371-
>>>>>>> 1edb0a38330b54d2e1916f5193fc043e6fbbea78
367+
```smart header="مقایسه کنید با `Object.is`"
368+
یک متد درون‌ساخت خاص به نام [Object.is](mdn:js/Object/is) وجود دارد که مقادیر را مثل `===` مقایسه میکند، اما برای دو حالت مرزی قابل اعتمادتر است:
372369
373370
۱. با `NaN` کار میکند: `Object.is(NaN, NaN) === true`، که چیز خوبیست.
374371
۲. مقادیر `0` و `-0` متفاوت هستند: `Object.is(0, -0) === false`، به ندرت اهمیت دارد، اما این مقادیر در اصل متفاوتند.
375372
376373
در تمام حالات دیگر، `Object.is(a, b)` با `a === b` برابراست.
377374
378-
<<<<<<< HEAD
379-
این روش مقایسه عموما در جاوااسکریپت استفاده می‌شود. وقتی یک الگوریتم درون سیستمی به مقایسه کردن برای برابری دقیق دو مقدار نیاز دارد، از `Object.is` استفاده می‌کند (که در درون سیستم به نام [SameValue](https://tc39.github.io/ecma262/#sec-samevalue)) می‌باشد.)
380-
=======
381-
We mention `Object.is` here, because it's often used in JavaScript specification. When an internal algorithm needs to compare two values for being exactly the same, it uses `Object.is` (internally called [SameValue](https://tc39.github.io/ecma262/#sec-samevalue)).
382-
>>>>>>> 1edb0a38330b54d2e1916f5193fc043e6fbbea78
375+
ما `Object.is` را اینجا ذکر می‌کنیم چون اغلب در مشخصات جاوااسکریپت استفاده می‌شود. زمانی که یک الگوریتم درونی نیاز دارد که دو مقدار را برای اینکه دقیقا یکسان باشند مقایسه کند، از `Object.is` استفاده می‌کند (از درون [SameValue](https://tc39.github.io/ecma262/#sec-samevalue) فراخوانی می‌شود).
383376
```
384377

385378

@@ -471,15 +464,10 @@ alert( parseInt('2n9c', 36) ); // 123456
471464
472465
برای آزمایش عادی عددها:
473466
474-
<<<<<<< HEAD
475467
- `isNaN(value)` آرگومان خود را به یک عدد تبدیل می‌کند و بررسی می‌کند که `NaN` است یا خیر.
468+
- `Number.isNaN(value)` بررسی می‌کند که آرگومان آن به نوع `number` تعلق دارد یا خیر و اگر داشت، بررسی می‌کند که `NaN` هست یا خیر
476469
- `isFinite(value)` آرگومان خود را به عدد تبدیل می‌کند و اگر یک عدد معمولی باشد `true` برمی‌گرداند نه اینکه `NaN/Infinity/-Infinity` باشد.
477-
=======
478-
- `isNaN(value)` converts its argument to a number and then tests it for being `NaN`
479-
- `Number.isNaN(value)` checks whether its argument belongs to the `number` type, and if so, tests it for being `NaN`
480-
- `isFinite(value)` converts its argument to a number and then tests it for not being `NaN/Infinity/-Infinity`
481-
- `Number.isFinite(value)` checks whether its argument belongs to the `number` type, and if so, tests it for not being `NaN/Infinity/-Infinity`
482-
>>>>>>> 1edb0a38330b54d2e1916f5193fc043e6fbbea78
470+
- `Number.isFinite(vlaue)` بررسی می‌کند که آیا آرگومان آن به نوع `number` تعلق دارد یا خیر و اگر داشت، بررسی می‌کند که `NaN/Infinity/-Infinity` نباشد
483471
484472
برای تبدیل مقادیری مثل `12pt` و `100px` به یک عدد:
485473

0 commit comments

Comments
 (0)