2018-10-16 21:32:40 +05:30

388 B

title
title
Accessing Object Properties with Variables

Accessing Object Properties with Variables

Here's a working solution in case you are stuck:

// 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