Skip to content

Commit afcf899

Browse files
committed
Progress on Mixins
1 parent cd42b29 commit afcf899

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

1-js/09-classes/07-mixins/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Mixins
22

3-
In JavaScript we can only inherit from a single object. There can be only one `[[Prototype]]` for an object. And a class may extend only one other class.
3+
فى جافاسكريبت يمكننا الوراثة من كائن واحد فقط. يمكن ان يوجد `[[Prototype]]` واحد فقط للكائن. و يمكن للـ `class` ان يقوم بـ `extend` فقط من `class` واحد آخر.
44

5-
But sometimes that feels limiting. For instance, we have a class `StreetSweeper` and a class `Bicycle`, and want to make their mix: a `StreetSweepingBicycle`.
5+
و لكن في بعض الأحيان ذلك يوحي بالتقييد. مثال علي ذلك, لدينا `class` هو `StreetSweeper` و `class` آخر هو `Bicycle`, و نريد تكوين ذلك المزيج بينهم: و هو `StreetSweepingBicycle`.
66

7-
Or we have a class `User` and a class `EventEmitter` that implements event generation, and we'd like to add the functionality of `EventEmitter` to `User`, so that our users can emit events.
7+
أو لدينا `class` هو `User` و `class` آخر هو `EventEmitter` الذي يقوم بتنفيذ إستخراج الأحداث, و نريد الآن إضافة دوال `EventEmitter` إلى `User`, لكي يمكن مستخدمينا من إرسال الأحداث.
88

9-
There's a concept that can help here, called "mixins".
9+
يوجد مفهوم يمكن أن يساعدنا هنا, يُسيمى `mixins`.
1010

1111
As defined in Wikipedia, a [mixin](https://en.wikipedia.org/wiki/Mixin) is a class containing methods that can be used by other classes without a need to inherit from it.
1212

0 commit comments

Comments
 (0)