Tell us what’s happening:
plz can someone help me , im stuck here , i don’t know where is the problem.
Your code so far
// Setup
var testObj = {
12: "Namath",
16: "Montana",
19: "Unitas"
};
// Only change code below this line;
var playerNumber=testObj[16]; // Change this Line
var player = playerNumber; // Change this Line
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.
Question says that playerNumber should be the properties of testObj ( in this case is a number 16), then only you can assign it to access the value .
// 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
@dollamaker To add to the above replies, playerNumber is a variable that will be used to get the name of a player. To get the name of a player in testObj, one must use the player’s number.
Create a playerNumber variable set to a player’s number
Use the playerNumber variable to get the player’s name from testObj