Skip to content

Commit b790c97

Browse files
committed
merging all conflicts
2 parents acad004 + 6989312 commit b790c97

14 files changed

Lines changed: 71 additions & 11 deletions

File tree

1-js/01-getting-started/1-intro/article.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@
6464

6565

6666

67+
<<<<<<< HEAD
6768
## جاوا اِسکریپت در مرورگر چه توانایی‌هایی دارد ؟
69+
=======
70+
JavaScript's abilities in the browser are limited for the sake of a user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.
71+
>>>>>>> 6989312841d843f2350803ab552d9082437be569
6872
6973

7074

@@ -86,6 +90,7 @@
8690

8791
- اِلِمان‌های HTML به صفحه اضافه نماید، محتوای فعلی را تغییر دهد و استایل‌ها را اصلاح کند.
8892

93+
<<<<<<< HEAD
8994
- با کابر در تعامل باشد، و نسبت به کلیک‌ها، فشردن دکمه‌ها و حرکت موس عکس‌العمل نشان دهد.
9095

9196
- درخواست‌ها مورد نظر را در سطح شبکه ارسال و دریافت کند، فایل آپلود و دانلود کند (که به این نوع تکنولوژی‌ها اصطلاحا [AJAX](https://en.wikipedia.org/wiki/Ajax_(programming)) و [COMET](https://en.wikipedia.org/wiki/Comet_(programming)) گفته می‌شود)
@@ -151,6 +156,14 @@
151156
به همین دلیل جاوا اِسکریپت شایع‌ترین ابزار برای ساخت رابط‌های کاربری در مرورگر‌ها می‌باشد.
152157

153158

159+
=======
160+
```compare
161+
+ Full integration with HTML/CSS.
162+
+ Simple things are done simply.
163+
+ Supported by all major browsers and enabled by default.
164+
```
165+
JavaScript is the only browser technology that combines these three things.
166+
>>>>>>> 6989312841d843f2350803ab552d9082437be569
154167
155168
## زبان‌هایی فراتر از جاوا اِسکریپت
156169

@@ -191,3 +204,9 @@
191204
- زبان‌های مختلفی وجود دارند که به جاوا اِسکریپت تبدیل می‌شوند تا بتوانند ویژگی‌های مشخصی را فراهم کنند. که پیشنهاد می‌کنیم حداقل یکی از آنها را بعد از تسلط به جاوا اِسکریپت مطالعه نمائید.
192205

193206

207+
<<<<<<< HEAD
208+
=======
209+
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
210+
- Today, JavaScript has a unique position as the most widely-adopted browser language, fully integrated with HTML/CSS.
211+
- There are many languages that get "transpiled" to JavaScript and provide certain features. It is recommended to take a look at them, at least briefly, after mastering JavaScript.
212+
>>>>>>> 6989312841d843f2350803ab552d9082437be569

1-js/06-advanced-functions/03-closure/9-sort-by-field/_js.view/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("byField", function(){
2323
{ name: "John", age: 20, surname: "Johnson"},
2424
];
2525
let ageSortedAnswer = users.sort(byField("age"));
26-
assert.deepEqual(ageSortedKey, ageSortedKey);
26+
assert.deepEqual(ageSortedKey, ageSortedAnswer);
2727
});
2828

2929
it("sorts users by surname", function(){

1-js/06-advanced-functions/10-bind/article.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,13 @@ let user = {
187187

188188
let say = user.say.bind(user);
189189

190+
<<<<<<< HEAD
190191
say("سلام"); // (پاس داده شد say آرگومان «سلام» به) !John ،سلام
191192
say("خداحافظ"); // (پاس داده شد say آرگومان «خداحافظ» به) !John ،خداحافظ
193+
=======
194+
say("Hello"); // Hello, John! ("Hello" argument is passed to say)
195+
say("Bye"); // Bye, John! ("Bye" is passed to say)
196+
>>>>>>> 6989312841d843f2350803ab552d9082437be569
192197
```
193198

194199
````smart header="روش راحت: `bindAll`"

1-js/09-classes/06-instanceof/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The algorithm of `obj instanceof Class` works roughly as follows:
9393
alert(rabbit instanceof Animal); // true
9494
*/!*
9595
96-
// rabbit.__proto__ === Rabbit.prototype
96+
// rabbit.__proto__ === Animal.prototype (no match)
9797
*!*
9898
// rabbit.__proto__.__proto__ === Animal.prototype (match!)
9999
*/!*

1-js/11-async/03-promise-chaining/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The idea is that the result is passed through the chain of `.then` handlers.
3737
Here the flow is:
3838
1. The initial promise resolves in 1 second `(*)`,
3939
2. Then the `.then` handler is called `(**)`, which in turn creates a new promise (resolved with `2` value).
40-
3. The next `then` `(***)` gets the result of the previous one, processes it (doubles) and passes the next handler.
40+
3. The next `then` `(***)` gets the result of the previous one, processes it (doubles) and passes it to the next handler.
4141
4. ...and so on.
4242

4343
As the result is passed along the chain of handlers, we can see a sequence of `alert` calls: `1` -> `2` -> `4`.

1-js/11-async/08-async-await/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ The `async` keyword before a function has two effects:
303303
304304
The `await` keyword before a promise makes JavaScript wait until that promise settles, and then:
305305
306-
1. If it's an error, the exception is generated — same as if `throw error` were called at that very place.
306+
1. If it's an error, an exception is generated — same as if `throw error` were called at that very place.
307307
2. Otherwise, it returns the result.
308308
309309
Together they provide a great framework to write asynchronous code that is easy to both read and write.

1-js/13-modules/01-modules-intro/article.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,11 @@ sayHi(); // Ready to serve, *!*Pete*/!*!
261261
262262
اسکریپت ها از نوع ماژول نسبت به انواع معمولی آن تفاوت هایی مخصوص محیط مرورگر هم دارند.
263263
264+
<<<<<<< HEAD
264265
اگر این اولین بار است که این آموزش را می خوانید، یا از جاوااسکریپت در مرورگر استفاده نمی کنید، می توانید این بخش را رد کنید.
266+
=======
267+
You may want to skip this section for now if you're reading for the first time, or if you don't use JavaScript in a browser.
268+
>>>>>>> 6989312841d843f2350803ab552d9082437be569
265269
266270
### اسکریپت های ماژولی به تعویق افتاده اند. (deferred)
267271

2-ui/1-document/05-basic-dom-node-properties/article.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ The classes are:
2525
- [HTMLInputElement](https://html.spec.whatwg.org/multipage/forms.html#htmlinputelement) -- the class for `<input>` elements,
2626
- [HTMLBodyElement](https://html.spec.whatwg.org/multipage/semantics.html#htmlbodyelement) -- the class for `<body>` elements,
2727
- [HTMLAnchorElement](https://html.spec.whatwg.org/multipage/semantics.html#htmlanchorelement) -- the class for `<a>` elements,
28-
- ...and so on, each tag has its own class that may provide specific properties and methods.
28+
- ...and so on.
29+
30+
There are many other tags with their own classes that may specific properties and methods, while some elements, such as `<span>`, `<section>`, `<article>` do not have any specific properties, so they are instances of `HTMLElement` class.
2931

3032
So, the full set of properties and methods of a given node comes as the result of the inheritance.
3133

@@ -128,7 +130,7 @@ For instance:
128130
129131
```html run
130132
<body>
131-
<script>
133+
<script>
132134
let elem = document.body;
133135
134136
// let's examine what it is?

2-ui/1-document/09-size-and-scroll/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function isHidden(elem) {
116116
}
117117
```
118118
119-
Please note that such `isHidden` returns `true` for elements that are on-screen, but have zero sizes (like an empty `<div>`).
119+
Please note that such `isHidden` returns `true` for elements that are on-screen, but have zero sizes.
120120
````
121121

122122
## clientTop/Left

2-ui/2-events/01-introduction-browser-events/article.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ button.onclick = sayThanks;
160160
button.onclick = sayThanks();
161161
```
162162

163+
<<<<<<< HEAD
163164
اگر که ما پرانتزها را اضافه کنیم تابع `sayThanks()` صدا زده می‌شود. پس مورد دوم درواقع *خروجی* حاصل از اجرای تابع را، که `undefined` است (چون تابع چیزی را باز نمی‌گرداند)، به عنوان کنترل‌کننده به `onclick` اختصاص می‌دهد، که قاعدتا کار نمی‌کند.
165+
=======
166+
If we add parentheses, then `sayThanks()` becomes a function call. So the last line actually takes the *result* of the function execution, that is `undefined` (as the function returns nothing), and assigns it to `onclick`. That doesn't work.
167+
>>>>>>> 6989312841d843f2350803ab552d9082437be569
164168
165169
...از سوی دیگر، ما در کد HTML به پرانتز ها نیاز داریم:
166170

0 commit comments

Comments
 (0)