--- id: 587d7daf367417b2b2512b7d title: Iterate Over All Properties challengeType: 1 videoUrl: '' localeTitle: تكرار جميع الممتلكات --- ## Description
لقد رأيت الآن نوعين من الخصائص: الخصائص own وخواص prototype . يتم تعريف الخصائص Own مباشرة على مثيل الكائن نفسه. يتم تعريف خصائص prototype على prototype .
وظيفة الطيور (الاسم) {
this.name = name؛ //الملكية الخاصة
}

Bird.prototype.numLegs = 2؛ // الملكية النموذج

السماح بطة = الطيور الجديدة ("دونالد") ؛
هنا هو كيف يمكنك إضافة duck الصورة own خصائص لمجموعة ownProps و prototype خصائص لمجموعة prototypeProps :
let ownProps = []؛
السماح لـ prototypeProps = []؛

ل (دع الممتلكات في البط) {
if (duck.hasOwProProty (property)) {
ownProps.push (الملكية)؛
} آخر {
prototypeProps.push (الملكية)؛
}
}

console.log (ownProps)؛ // printts ["name"]
console.log (prototypeProps)؛ // prints ["numLegs"]
## Instructions
إضافة جميع الخصائص own beagle إلى مجموعة ownProps . إضافة كل خصائص prototype Dog إلى مجموعة prototypeProps .
## Tests
```yml tests: - text: يجب أن تتضمن صفيف ownProps "name" . testString: 'assert(ownProps.indexOf("name") !== -1, "The ownProps array should include "name".");' - text: يجب أن تتضمن صفيف prototypeProps "numLegs" . testString: 'assert(prototypeProps.indexOf("numLegs") !== -1, "The prototypeProps array should include "numLegs".");' - text: حل هذا التحدي دون استخدام الأسلوب Object.keys() . testString: 'assert(!/\Object.keys/.test(code), "Solve this challenge without using the built in method Object.keys().");' ```
## Challenge Seed
```js function Dog(name) { this.name = name; } Dog.prototype.numLegs = 4; let beagle = new Dog("Snoopy"); let ownProps = []; let prototypeProps = []; // Add your code below this line ```
## Solution
```js // solution required ```