Skip to content

Commit 744674a

Browse files
committed
merging all conflicts
2 parents 17a9208 + ff4ef57 commit 744674a

11 files changed

Lines changed: 338 additions & 7 deletions

File tree

1-js/02-first-steps/04-variables/3-uppercast-constant/task.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,24 @@ const birthday = '18.04.1982';
1212
const age = someCode(birthday);
1313
```
1414

15+
<<<<<<< HEAD
1516
ما در اینجا یک ثابت با نام `birthday` داریم و ثابتی دیگر با نام `age` که با کمک کدهای دیگر از `birthday` محاسبه می‌شود (برای کوتاه شدن ارائه نشده‌است، و همچنین به دلیل اینکه جزییات اینجا اهمیت ندارند).
17+
=======
18+
Here we have a constant `birthday` for the date, and also the `age` constant.
19+
20+
The `age` is calculated from `birthday` using `someCode()`, which means a function call that we didn't explain yet (we will soon!), but the details don't matter here, the point is that `age` is calculated somehow based on the `birthday`.
21+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
1622
1723
آیا نوشتن `birthday` با حروف بزرگ درست است؟ برای `age` چطور؟
1824

1925
```js
26+
<<<<<<< HEAD
2027
const BIRTHDAY = '18.04.1982'; // با حروف بزرگ؟
2128

2229
const AGE = someCode(BIRTHDAY); // با حروف بزرگ؟
23-
```
30+
=======
31+
const BIRTHDAY = '18.04.1982'; // make birthday uppercase?
2432

33+
const AGE = someCode(BIRTHDAY); // make age uppercase?
34+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
35+
```

1-js/04-object-basics/06-constructor-new/2-calculator-constructor/task.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ importance: 5
66

77
یک تابع سازنده `Calculator` بسازید که شیء هایی با 3 متد ایجاد می کند.
88

9+
<<<<<<< HEAD
910
- `read()` با استفاده از `prompt` برای دو مقدار درخواست می کند و آنها را در ویژگی های خود به خاطر می سپارد.
1011
- `sum()` مجموع این ویژگی ها را بر می گرداند.
1112
- `mul()` حاصل ضرب این ویژگی ها را بر می گرداند.
13+
=======
14+
- `read()` prompts for two values and saves them as object properties with names `a` and `b` respectively.
15+
- `sum()` returns the sum of these properties.
16+
- `mul()` returns the multiplication product of these properties.
17+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
1218
1319
برای مثال:
1420

1-js/05-data-types/03-string/article.md

Lines changed: 192 additions & 3 deletions
Large diffs are not rendered by default.

1-js/05-data-types/04-array/10-maximal-subarray/solution.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ alert( getMaxSubSum([100, -9, 2, -3, 5]) ); // 100
5959

6060
این راه حل یک پیچیدگی زمانی [O(n<sup>2</sup>)](https://fa.wikipedia.org/wiki/نماد_O_بزرگ) دارد، به عبارتی دیگر، اگر ما اندازه آرایه را دو برابر کنیم، الگوریتم 4 برابر بیشتر زمان می‌برد.
6161

62+
<<<<<<< HEAD
6263
برای آرایه‌های بزرگ (1000، 10000 یا المان‌های بیشتر) چنین الگوریتمی می‌تواند باعث سستی جدی شود.
64+
=======
65+
For big arrays (1000, 10000 or more items) such algorithms can lead to serious sluggishness.
66+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
6367
6468
# راه حل سریع
6569

@@ -91,4 +95,8 @@ alert( getMaxSubSum([-1, -2, -3]) ); // 0
9195

9296
الگوریتم دقیقا به 1 آرایه نیاز دارد، پس پیچیدگی زمان O(n) است.
9397

98+
<<<<<<< HEAD
9499
شما می‌توانید اطلاعات بیشتری درباره الگوریتم را اینجا پیدا کنید: [مسئله زیرآرایه بیشینه](http://en.wikipedia.org/wiki/Maximum_subarray_problem). اگر هنوز هم برای شما مشخص نیست که چرا کار می‌کند، لطفا الگوریتم را در مثال بالا دنبال کنید، ببینید چگونه کار می‌کند، این کار بهتر از حرفی است.
100+
=======
101+
You can find more detailed information about the algorithm here: [Maximum subarray problem](http://en.wikipedia.org/wiki/Maximum_subarray_problem). If it's still not obvious why that works, then please trace the algorithm on the examples above, see how it works, that's better than any words.
102+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4

1-js/05-data-types/04-array/2-create-array/task.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ importance: 5
66

77
بیایید 5 عملیات آرایه را امتحان کنیم.
88

9+
<<<<<<< HEAD
910
1. یک آرایه `styles` با المان‌های "Jazz" و "Blues" ایجاد کنید.
1011
2. "Rock-n-Roll" را به انتهای آن اضافه کنید.
1112
3. مقدار وسطی را با "Classics" جایگزین کنید. کد شما برای پیدا کردن مقدار وسط باید برای هر آرایه‌ای با طول فرد کار کند.
1213
4. مقدار اول آرایه را بیرون بیاورید و آن را نمایش دهید.
1314
5. دو مقدار `Rap` و `Reggae` را به اول آرایه اضافه کنید.
15+
=======
16+
1. Create an array `styles` with items "Jazz" and "Blues".
17+
2. Append "Rock-n-Roll" to the end.
18+
3. Replace the value in the middle with "Classics". Your code for finding the middle value should work for any arrays with odd length.
19+
4. Strip off the first value of the array and show it.
20+
5. Prepend `Rap` and `Reggae` to the array.
21+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
1422
1523
آرایه در حین فرایند اینگونه خواهد بود:
1624

1-js/05-data-types/07-map-set/article.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,23 @@
1414

1515
متدها و ویژگی‌های آن:
1616

17+
<<<<<<< HEAD
1718
- `new Map()` -- map را می‌سازد.
1819
- `map.set(key, value)` -- value را به واسطه key ذخیره می‌کند.
1920
- `map.get(key)` -- مقدار را به واسطه key برمی‌گرداند، اگر `key` در map وجود نداشته باشد `undefined` برگردانده می‌شود.
2021
- `map.has(key)` -- اگر `key` وجود داشته باشد `true` برگردانده می‌شود، در غیر این صورت `false`.
2122
- `map.delete(key)` -- مقدار را به واسطه key حذف می‌کند.
2223
- `map.clear()` -- همه چیز را از map حذف می‌کند.
2324
- `map.size` -- تعداد المان‌های کنونی را برمی‌گرداند.
25+
=======
26+
- `new Map()` -- creates the map.
27+
- [`map.set(key, value)`](mdn:js/Map/set) -- stores the value by the key.
28+
- [`map.get(key)`](mdn:js/Map/get) -- returns the value by the key, `undefined` if `key` doesn't exist in map.
29+
- [`map.has(key)`](mdn:js/Map/has) -- returns `true` if the `key` exists, `false` otherwise.
30+
- [`map.delete(key)`](mdn:js/Map/delete) -- removes the value by the key.
31+
- [`map.clear()`](mdn:js/Map/clear) -- removes everything from the map.
32+
- [`map.size`](mdn:js/Map/size) -- returns the current element count.
33+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
2434
2535
برای مثال:
2636

@@ -105,9 +115,15 @@ map.set('1', 'str1')
105115
106116
برای حلقه زدن در `map` 3 متد وجود دارد:
107117
118+
<<<<<<< HEAD
108119
- `map.keys()` -- یک حلقه‌پذیر برای کلیدها برمی‌گرداند،
109120
- `map.values()` -- یک حلقه‌پذیر برای مقدارها برمی‌گرداند،
110121
- `map.entries()` -- یک حلقه‌پذیر برای برای اطلاعات به شکل `[key, value]` برمی‌گرداند که به صورت پیش‌فرض در `for..of` استفاده می‌شود.
122+
=======
123+
- [`map.keys()`](mdn:js/Map/keys) -- returns an iterable for keys,
124+
- [`map.values()`](mdn:js/Map/values) -- returns an iterable for values,
125+
- [`map.entries()`](mdn:js/Map/entries) -- returns an iterable for entries `[key, value]`, it's used by default in `for..of`.
126+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
111127
112128
برای مثال:
113129
@@ -237,12 +253,21 @@ let obj = Object.fromEntries(map); // را حذف کردیم .entries()
237253
238254
متدهای اصلی آن:
239255
256+
<<<<<<< HEAD
240257
- `new Set(iterable)` -- set را ایجاد می‌کند و اگر یک شیء حلقه‌پذیر داده شود (معمولا یک آرایه)، مقدارها را از آن درون set کپی می‌کند.
241258
- `set.add(value)` -- یک مقدار اضافه می‌کند و خود set را برمی‌گرداند.
242259
- `set.delete(value)` -- مقدار را حذف می‌کند و اگر `value` هنگام فراخوانی وجود داشته باشد `true` را برمی‌گرداند، در غیر این صورت `false`.
243260
- `set.has(value)` -- اگر مقدار در set وجود داشته باشد `true` را برمی‌گرداند، در غیر این صورت `false`.
244261
- `set.clear()` -- همه چیز را از set حذف می‌کند.
245262
- `set.size` -- برابر با تعداد المان‌ها است.
263+
=======
264+
- `new Set(iterable)` -- creates the set, and if an `iterable` object is provided (usually an array), copies values from it into the set.
265+
- [`set.add(value)`](mdn:js/Set/add) -- adds a value, returns the set itself.
266+
- [`set.delete(value)`](mdn:js/Set/delete) -- removes the value, returns `true` if `value` existed at the moment of the call, otherwise `false`.
267+
- [`set.has(value)`](mdn:js/Set/has) -- returns `true` if the value exists in the set, otherwise `false`.
268+
- [`set.clear()`](mdn:js/Set/clear) -- removes everything from the set.
269+
- [`set.size`](mdn:js/Set/size) -- is the elements count.
270+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
246271
247272
ویژگی اصلی این اصت که فراخوانی‌های پی‌در‌پی `set.add(value)` با مقداری یکسان، کاری انجام نمی‌دهد. به همین دلیل است که هر مقدار تنها یک بار در `Set` واقع می‌شوند.
248273
@@ -291,27 +316,47 @@ set.forEach((value, valueAgain, set) => {
291316
292317
یک چیز جالب را در نظر داشته باشید. تابعی که به `forEach` داده شده 3 آرگومان دارد: یک `value`، سپس *مقدار یکسان* `valueAgain` و سپس شیء مورد نظر. در واقع، مقداری یکسان دو بار در آرگومان ظاهر می‌شود.
293318
319+
<<<<<<< HEAD
294320
این به دلیل سازگاری با `Map` است که تابع داده شده به `forEach` دارای 3 آرگومان است. قطعا کمی عجیب به نظر می‌رسد. اما می‌تواند به جایگزینی `Map` با `Set` و برعکس در بعضی موارد کمک کند.
321+
=======
322+
That's for compatibility with `Map` where the callback passed `forEach` has three arguments. Looks a bit strange, for sure. But this may help to replace `Map` with `Set` in certain cases with ease, and vice versa.
323+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
295324
296325
همچنین متدهای مشابهی که `Map` هم برای حلقه‌زننده‌ها دارد، پشتیبانی می‌شوند:
297326
327+
<<<<<<< HEAD
298328
- `set.keys()` -- یک شیء حلقه‌پذیر برای مقدارها را برمی‌گرداند،
299329
- `set.values()` -- با `set.keys()` یکسان است، برای سازگاری با `Map`
300330
- `set.entries()` -- یک شیء حلقه‌پذیر را برای اطلاعات به شکل `[value, value]` برمی‌گرداند، برای سازگاری با `Map` وجود دارد.
331+
=======
332+
- [`set.keys()`](mdn:js/Set/keys) -- returns an iterable object for values,
333+
- [`set.values()`](mdn:js/Set/values) -- same as `set.keys()`, for compatibility with `Map`,
334+
- [`set.entries()`](mdn:js/Set/entries) -- returns an iterable object for entries `[value, value]`, exists for compatibility with `Map`.
335+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
301336
302337
## خلاصه
303338
304339
`Map` -- یک مجموعه از مقدارهای کلیددار است.
305340
306341
متدها و ویژگی‌های آن:
307342
343+
<<<<<<< HEAD
308344
- `new Map([iterable])` -- map را می‌سازد، برای مقداردهی اولیه از `iterable`(حلقه‌پذیر) اختیاری (مانند آرایه) از جفت‌های `[key,value]` می‌توان استفاده کرد.
309345
- `map.set(key, value)` -- مقدار را به واسطه کلید ذخیره می‌کند، خود map را برمی‌گرداند.
310346
- `map.get(key)` -- مقدار را به واسطه کلید برمی‌گرداند، اگر `key` در map وجود نداشته باشد `undefined` برمی‌گرداند.
311347
- `map.has(key)` -- اگر `key` وجود داشته باشد `true` برمی‌گرداند، در غیر این صورت `false`.
312348
- `map.delete(key)` -- مقدار را به واسطه کلید حذف می‌کند، اگر `key` در لحظه فراخوانی وجود داشته باشد `true` برمی‌گرداند، در غیر این صورت `false`.
313349
- `map.clear()` -- همه چیز را از map حذف می‌کند.
314350
- `map.size` -- تعداد المان‌ها را برمی‌گرداند.
351+
=======
352+
- `new Map([iterable])` -- creates the map, with optional `iterable` (e.g. array) of `[key,value]` pairs for initialization.
353+
- [`map.set(key, value)`](mdn:js/Map/set) -- stores the value by the key, returns the map itself.
354+
- [`map.get(key)`](mdn:js/Map/get)` -- returns the value by the key, `undefined` if `key` doesn't exist in map.
355+
- [`map.has(key)`](mdn:js/Map/has) -- returns `true` if the `key` exists, `false` otherwise.
356+
- [`map.delete(key)`](mdn:js/Map/delete) -- removes the value by the key, returns `true` if `key` existed at the moment of the call, otherwise `false`.
357+
- [`map.clear()`](mdn:js/Map/clear) -- removes everything from the map.
358+
- [`map.size`](mdn:js/Map/size) -- returns the current element count.
359+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
315360
316361
تفاوت آن با `Object` معمولی:
317362
@@ -322,11 +367,20 @@ set.forEach((value, valueAgain, set) => {
322367
323368
متدها و ویژگی‌های آن:
324369
370+
<<<<<<< HEAD
325371
- `new Set([iterable])` -- set را ایجاد می‌کند، برای مقداردهی اولیه می‌توان از `iterable`(حلقه‌پذیر مانند آرایه) شامل مقدارها استفاده کرد.
326372
- `set.add(value)` -- یک مقدار را اضافه می‌کند (اگر `value` وجود داشته باشد کاری نمی‌کند)، خود set را برمی‌گرداند.
327373
- `set.delete(value)` -- مقدار را حذف می‌کند، اگر `value` هنگام فراخوانی وجود داشته باشد `true` را برمی‌گرداند، در غیر این صورت `false`.
328374
- `set.has(value)` -- اگر مقدار در set وجود داشته باشد `true` را برمی‌گرداند، در غیر این صورت `false`.
329375
- `set.clear()` -- همه چیز را از set حذف می‌کند.
330376
- `set.size` -- برابر با تعداد المان‌ها است.
377+
=======
378+
- `new Set([iterable])` -- creates the set, with optional `iterable` (e.g. array) of values for initialization.
379+
- [`set.add(value)`](mdn:js/Set/add) -- adds a value (does nothing if `value` exists), returns the set itself.
380+
- [`set.delete(value)`](mdn:js/Set/delete) -- removes the value, returns `true` if `value` existed at the moment of the call, otherwise `false`.
381+
- [`set.has(value)`](mdn:js/Set/has) -- returns `true` if the value exists in the set, otherwise `false`.
382+
- [`set.clear()`](mdn:js/Set/clear) -- removes everything from the set.
383+
- [`set.size`](mdn:js/Set/size) -- is the elements count.
384+
>>>>>>> ff4ef57c8c2fd20f4a6aa9032ad37ddac93aa3c4
331385
332386
حلقه‌زدن در `Map` و `Set` همیشه با ترتیب اضافه‌کردن انجام می‌شود، پس ما نمی‌توانیم بگوییم این مجموعه‌ها نامرتب هستند اما نمی‌توانیم المان‌ها را دوباره مرتب کنیم یا به صورت مستقیم یک المان را با استفاده از عدد آن دریافت کنیم.

1-js/12-generators-iterators/1-generators/01-pseudo-random-generator/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function* pseudoRandom(seed) {
33
let value = seed;
44

55
while(true) {
6-
value = value * 16807 % 2147483647
6+
value = value * 16807 % 2147483647;
77
yield value;
88
}
99

1-js/99-js-misc/04-reference-type/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The result of a property access `user.hi` is not a function, but a value of Refe
8787
(user, "hi", true)
8888
```
8989

90-
When parentheses `()` are called on the Reference Type, they receive the full information about the object and its method, and can set the right `this` (`=user` in this case).
90+
When parentheses `()` are called on the Reference Type, they receive the full information about the object and its method, and can set the right `this` (`user` in this case).
9191

9292
Reference type is a special "intermediary" internal type, with the purpose to pass information from dot `.` to calling parentheses `()`.
9393

0 commit comments

Comments
 (0)