freeCodeCamp/curriculum/challenges/russian/02-javascript-algorithms-an.../basic-javascript/accessing-object-properties...

2.1 KiB
Raw Blame History

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>&quot;ballcap&quot;</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>&quot;jersey&quot;</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