--- id: 587d7dae367417b2b2512b7b title: Understand Own Properties challengeType: 1 videoUrl: '' localeTitle: فهم خصائص خاصة --- ## Description
في المثال التالي ، يعرف منشئ Bird خاصيتين: name و numLegs :
وظيفة الطيور (الاسم) {
this.name = name؛
this.numLegs = 2 ،
}

السماح بطة = الطيور الجديدة ("دونالد") ؛
السماح الكناري = الطيور الجديدة ("تويتي") ؛
name و numLegs تسمى الخصائص own ، لأنها محددة مباشرة على كائن مثيل. وهذا يعني أن كل من duck canary له نسخة منفصلة خاصة به من هذه الخصائص. في الواقع ، سيكون لكل نسخة من Bird نسخة خاصة بها من هذه الخصائص. التعليمة البرمجية التالية يضيف كل من own خصائص duck لمجموعة ownProps :
let ownProps = []؛

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

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