|
1 | 1 |
|
2 | | -با توجه به موارد زیر. |
| 2 | +Here's the explanations. |
3 | 3 |
|
4 | | -1. متدی که داخل یک آبجکت معمولی بوده, اجرا شده. |
| 4 | +1. That's a regular object method call. |
5 | 5 |
|
6 | | -2. به همین ترتیب, پرانتز در اینجا اولیت را عوض نمیکند و مهم نقطه `.` است. |
| 6 | +2. The same, parentheses do not change the order of operations here, the dot is first anyway. |
7 | 7 |
|
8 | | -3. ما نمونه پیچیده تری نسبت به `()(expression)`. در زیر داریم که به دو خط کد تقسیم شده است: |
| 8 | +3. Here we have a more complex call `(expression)()`. The call works as if it were split into two lines: |
9 | 9 |
|
10 | 10 | ```js no-beautify |
11 | | - f = obj.go; // محاسبه عبارت |
12 | | - f(); // اجرای تابع |
| 11 | + f = obj.go; // calculate the expression |
| 12 | + f(); // call what we have |
13 | 13 | ``` |
14 | 14 |
|
15 | | - اینجا `()f` به عنوان یک تابع, بدون `this` اجرا میشود. |
| 15 | + Here `f()` is executed as a function, without `this`. |
16 | 16 |
|
17 | | -4. در موارد مشابه `(3)`, در سمت چپ پرانتز عبارت داریم. |
| 17 | +4. The similar thing as `(3)`, to the left of the parentheses `()` we have an expression. |
18 | 18 |
|
19 | | -برای اینکه اتفاقاتی که در مورد `(3)` و `(4)` رج میدهد را بدانیم, باید به خاطر داشته باشیم که دسترسی به مقدار ویژگی ها (چه با نقطه یا چه با استفاده از براکت) یک مقداری از Reference Type را برمیگرداند. |
| 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. |
20 | 20 |
|
21 | | -هر عملیاتی که برروی آن غیر از توابع (مثل عملگر تخصیص `=` یا `||`) اعمال میشود, از آن یک مقدار معمولی میسازد, که اطلاعاتی برای تنظیم مقدار `this` ندارد. |
| 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`. |
0 commit comments