--- id: 56533eb9ac21ba0edf2244c7 title: Accessing Object Properties with Dot Notation challengeType: 1 videoUrl: '' localeTitle: الوصول إلى خصائص كائن مع ترميز Dot --- ## Description
هناك طريقتان للوصول إلى خصائص كائن: تدوين نقطي ( . ) وتدوين قوس ( [] ) ، شبيه بصفيف. Dot notation هو ما تستخدمه عندما تعرف اسم العقار الذي تحاول الوصول إليه في وقت مبكر. هنا عينة من استخدام تدوين النقطة ( . ) لقراءة خاصية الكائن:
var myObj = {
prop1: "val1" ،
prop2: "val2"

var prop1val = myObj.prop1 ، // val1
var prop2val = myObj.prop2؛ // val2
## Instructions
قراءة في قيم خاصية testObj باستخدام التدوين النقطي. تعيين hatValue متغير يساوي hat خاصية الكائن وتعيين shirtValue متغير shirtValue يساوي shirt خاصية الكائن.
## Tests
```yml tests: - text: يجب أن يكون hatValue سلسلة testString: 'assert(typeof hatValue === "string" , "hatValue should be a string");' - text: قيمة hatValue يجب أن تكون "ballcap" testString: 'assert(hatValue === "ballcap" , "The value of hatValue should be "ballcap"");' - text: يجب أن يكون shirtValue عبارة عن سلسلة testString: 'assert(typeof shirtValue === "string" , "shirtValue should be a string");' - text: يجب أن تكون قيمة shirtValue "jersey" testString: 'assert(shirtValue === "jersey" , "The value of shirtValue should be "jersey"");' - text: يجب عليك استخدام dot notation مرتين testString: 'assert(code.match(/testObj\.\w+/g).length > 1, "You should use dot notation twice");' ```
## Challenge Seed
```js // Setup var testObj = { "hat": "ballcap", "shirt": "jersey", "shoes": "cleats" }; // Only change code below this line var hatValue = testObj; // Change this line var shirtValue = testObj; // Change this line ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```