Skip to content

Commit 28c8e97

Browse files
authored
Update solution.md
1 parent 7fa3497 commit 28c8e97

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • 1-js/99-js-misc/04-reference-type/3-why-this
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +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. به همین ترتیب, پرانتز در اینجا اولیت را عوض نمیکند و مهم نقطه `.` است.
77

8-
3. Here we have a more complex call `(expression)()`. The call works as if it were split into two lines:
8+
3. ما نمونه پیچیده تری نسبت به `()(expression)`. در زیر داریم که به دو خط کد تقسیم شده است:
99

1010
```js no-beautify
1111
f = obj.go; // calculate the expression
1212
f(); // call what we have
1313
```
1414

15-
Here `f()` is executed as a function, without `this`.
15+
اینجا `()f` به عنوان یک تابع, بدون `this` اجرا میشود.
1616

17-
4. The similar thing as `(3)`, to the left of the parentheses `()` we have an expression.
17+
4. در موارد مشابه `(3)`, در سمت چپ پرانتز عبارت داریم.
1818

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.
19+
برای اینکه اتفاقاتی که در مورد `(3)` و `(4)` رج میدهد را بدانیم, باید به خاطر داشته باشیم که دسترسی به مقدار ویژگی ها (چه با نقطه یا چه با استفاده از براکت) یک مقداری از Reference Type
2020

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`.
21+
هر عملیاتی که برروی آن غیر از توابع (مثل عملگر تخصیص `=` یا `||`) اعمال میشود, از آن یک مقدار معمولی میسازد, که اطلاعاتی برای تنظیم مقدار `this` ندارد.

0 commit comments

Comments
 (0)