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/08-prototypes/04-prototype-methods/article.md
-7Lines changed: 0 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,15 +57,8 @@ alert(rabbit.jumps); // true
57
57
يمكننا استخدام `Object.create` للقيام بنسخ كائن بشكل أفضل من نسخ الخصائص باستخدام التكرار `for..in`:
58
58
59
59
```js
60
-
<<<<<<<HEAD
61
60
// كائن جديد مماثل تمامًا
62
-
let clone =Object.create(
63
-
Object.getPrototypeOf(obj),
64
-
Object.getOwnPropertyDescriptors(obj)
65
-
);
66
-
=======
67
61
let clone =Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
68
-
>>>>>>> b52aa942a8e9b75ba8a65124c22593171e273bb6
69
62
```
70
63
71
64
هذا الإستدعاء يقوم بإنشاء نسخه طبق الأصل من الكائن `obj` بما فيه من خصائص سواءًا كانت معدودة (enumerable) أم لا وكذلك الجالبات والمغيرات (getters & setters) -- كل شيئ وبالخاصية `[[Prototype]]` الصحيحة.
0 commit comments