freeCodeCamp/guide/arabic/certifications/javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-variables/index.md
2019-06-20 16:05:02 -05:00

498 B

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