You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. The same, parentheses do not change the order of operations here, the dot is first anyway.
6
+
2. به همین ترتیب, پرانتز در اینجا اولیت را عوض نمیکند و مهم نقطه `.` است.
7
+
8
+
3. ما نمونه پیچیده تری نسبت به `()(expression)`. در زیر داریم که به دو خط کد تقسیم شده است.
7
9
8
-
3. Here we have a more complex call `(expression)()`. The call works as if it were split into two lines:
9
10
10
11
```js no-beautify
11
-
f =obj.go; //calculate the expression
12
-
f(); //call what we have
12
+
f =obj.go; //محاسبه عبارت و ریختن آن داخل یک متغیر
13
+
f(); //اجرای متد
13
14
```
15
+
اینجا `()f` به عنوان یک تابع, بدون `this` اجرا میشود.
14
16
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)`, در سمت چپ پرانتز عبارت داریم.
20
18
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 را برمیگرداند.
22
20
21
+
هر عملیات برروی آن غیر از توابع (مثل عملگر تخصیص `=` یا `||`) از آن یک مقدار معمولی میسازد. که اطلاعاتی برای تنظیم مقدار `this` ندارد.
0 commit comments