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
Copy file name to clipboardExpand all lines: 1-js/09-classes/05-extend-natives/article.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,22 +68,22 @@ alert(filteredArr.isEmpty()); // Error: filteredArr.isEmpty is not a function
68
68
مجموعههای دیگر، مثال `Map` و `Set`، همینطور کار میکنند. آنها هم از `Symbol.species` استفاده میکنند.
69
69
```
70
70
71
-
## No static inheritance in built-ins
71
+
## ارثبری ایستا در درونساختها وجود ندارد
72
72
73
-
Built-in objects have their own static methods, for instance`Object.keys`,`Array.isArray`etc.
73
+
شیءهای درونساخت متدهای ایستا خود را دارند، برای مثال`Object.keys`،`Array.isArray`و غیره.
74
74
75
-
As we already know, native classes extend each other. For instance,`Array`extends`Object`.
75
+
همانطور که از قبل میدانیم، کلاسهای نیتیو یکدیگر را تعمیم میدهند. برای مثال`Array`کلاس`Object` را تعمیم میدهد.
76
76
77
-
Normally, when one class extends another, both static and non-static methods are inherited. That was thoroughly explained in the article[](info:static-properties-methods#statics-and-inheritance).
77
+
طبیعاتا، زمانی که کلاسی کلاس دیگر را تعمیم میدهد، هم متدهای ایستا و هم متدهای غیر ایستا به ارث برده میشوند. این موضوع به طور کامل در مقاله[](info:static-properties-methods#statics-and-inheritance) توضیح داده شد.
78
78
79
-
But built-in classes are an exception. They don't inherit statics from each other.
79
+
اما کلاسهای درونساخت استثنا هستند. آنها ویژگیهای ایستا را از یکدیگر به ارث نمیبرند.
80
80
81
-
For example, both `Array`and`Date`inherit from `Object`, so their instances have methods from`Object.prototype`. But`Array.[[Prototype]]`does not reference `Object`, so there's no, for instance, `Array.keys()` (or`Date.keys()`) static method.
81
+
برای مثال، هر دو کلاس `Array`و`Date`از `Object` ارثبری میکنند، پس نمونههای آنها از`Object.prototype` متدهایی دارند. اما`Array.[[Prototype]]`به `Object` رجوع نمیکند پس برای مثال، مندهای ایستای `Array.keys()` (یا`Date.keys()`) وجود ندارند.
82
82
83
-
Here's the picture structure for `Date`and`Object`:
83
+
اینجا ساختاری تصویری برای `Date`و`Object` داریم:
84
84
85
85

86
86
87
-
As you can see, there's no link between `Date`and`Object`. They are independent, only`Date.prototype`inherits from `Object.prototype`.
87
+
همانطور که میبینید، بین `Date`و`Object` هیچ ارتباطی وجود ندارد. آنها مستقل هستند، فقط`Date.prototype`از `Object.prototype` ارثبری میکند.
88
88
89
-
That's an important difference of inheritance between built-in objects compared to what we get with `extends`.
89
+
این یک تفاوت مهم شیءهای درونساخت در مقایسه با چیزی است که از `extends` بدست میآوریم است.
0 commit comments