freeCodeCamp/guide/russian/certifications/javascript-algorithms-and-d.../basic-javascript/accessing-object-properties.../index.md

589 B
Raw Blame History

title localeTitle
Accessing Object Properties with Bracket Notation Доступ к объектным свойствам с помощью скобок

Доступ к объектным свойствам с помощью скобок

Вот одно из возможных решений:

var testObj = { 
  "an entree": "hamburger", 
  "my side": "veggies", 
  "the drink": "water" 
 }; 
 
 // Only change code below this line 
 
 var entreeValue = testObj["an entree"];   // Change this line 
 var drinkValue = testObj["the drink"];    // Change this line