Skip to content

Commit 843c6aa

Browse files
authored
Change: translate solution.md page on the why this directory.
1 parent 8febd2c commit 843c6aa

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

  • 1-js/99-js-misc/04-reference-type/3-why-this
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11

2-
Here's the explanations.
2+
با توجه به موارد زیر.
33

4-
1. That's a regular object method call.
4+
1. متد آبجکت معمولی اجرا شده.
55

6-
2. The same, parentheses do not change the order of operations here, the dot is first anyway.
6+
2. به همین ترتیب, پرانتز در اینجا اولیت را عوض نمیکند و مهم نقطه `.` است.
7+
8+
3. ما نمونه پیچیده تری نسبت به `()(expression)`. در زیر داریم که به دو خط کد تقسیم شده است.
79

8-
3. Here we have a more complex call `(expression)()`. The call works as if it were split into two lines:
910

1011
```js no-beautify
11-
f = obj.go; // calculate the expression
12-
f(); // call what we have
12+
f = obj.go; // محاسبه عبارت و ریختن آن داخل یک متغیر
13+
f(); // اجرای متد
1314
```
15+
اینجا `()f` به عنوان یک تابع, بدون `this` اجرا میشود.
1416

15-
Here `f()` is executed as a function, without `this`.
16-
17-
4. The similar thing as `(3)`, to the left of the parentheses `()` we have an expression.
18-
19-
To explain the behavior of `(3)` and `(4)` we need to recall that property accessors (dot or square brackets) return a value of the Reference Type.
17+
4. در موارد مشابه `(3)`, در سمت چپ پرانتز عبارت داریم.
2018

21-
Any operation on it except a method call (like assignment `=` or `||`) turns it into an ordinary value, which does not carry the information allowing to set `this`.
19+
برای اینکه اتفاقاتی که در مورد `(3)` و `(4)` رج میدهد را بدانیم, باید به خاطر داشته باشیم دسترسی به مقدار ویژگی ها (چه با نقطه یا چه با استفاده از براکت) یک مقداری از Reference Type را برمیگرداند.
2220

21+
هر عملیات برروی آن غیر از توابع (مثل عملگر تخصیص `=` یا `||`) از آن یک مقدار معمولی میسازد. که اطلاعاتی برای تنظیم مقدار `this` ندارد.

0 commit comments

Comments
 (0)