freeCodeCamp/guide/russian/certifications/javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-variables/index.md
2018-10-16 21:32:40 +05:30

518 B
Raw Blame History

title localeTitle
Accessing Object Properties with Variables Доступ к объектам с переменными

Доступ к объектам с переменными

Вот работающее решение, если вы застряли:

// Setup 
 var testObj = { 
  12: "Namath", 
  16: "Montana", 
  19: "Unitas" 
 }; 
 
 // Only change code below this line; 
 
 var playerNumber = 16;       // Change this Line 
 var player = testObj[playerNumber];   // Change this Line