2.1 KiB
2.1 KiB
id, title, challengeType, videoUrl, localeTitle
| id | title | challengeType | videoUrl | localeTitle |
|---|---|---|---|---|
| 56533eb9ac21ba0edf2244c7 | Accessing Object Properties with Dot Notation | 1 | Доступ к объектным свойствам с нотами Dot |
Description
undefined
Instructions
testObj с использованием точечной нотации. Установите переменную hatValue равное свойству объекта hat и установить переменную shirtValue равной свойству объекта shirt . Tests
tests:
- text: ''
testString: 'assert(typeof hatValue === "string" , "<code>hatValue</code> should be a string");'
- text: Значение <code>hatValue</code> должно быть <code>"ballcap"</code>
testString: 'assert(hatValue === "ballcap" , "The value of <code>hatValue</code> should be <code>"ballcap"</code>");'
- text: <code>shirtValue</code> должна быть строкой
testString: 'assert(typeof shirtValue === "string" , "<code>shirtValue</code> should be a string");'
- text: Значение <code>shirtValue</code> должно быть <code>"jersey"</code>
testString: 'assert(shirtValue === "jersey" , "The value of <code>shirtValue</code> should be <code>"jersey"</code>");'
- text: Вы должны использовать точную нотацию дважды
testString: 'assert(code.match(/testObj\.\w+/g).length > 1, "You should use dot notation twice");'
Challenge Seed
// 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
console.info('after the test');
Solution
// solution required