guys , my question is that in the code var playerNumber = 16 ;
16 is an example in this challenge? I mean it might be other numbers as well in stead of 16. can we write a general code for any other number? Thanks.
Your code so far
// 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
console.log(testObj[16])
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/604.3.5 (KHTML, like Gecko) Version/11.0.1 Safari/604.3.5.
Challenge: Accessing Object Properties with Variables
@narmada_nannaka@ilenia w hat is not clear for is that why we have to assign the code to 16 ? as I tried with console.log if I change the number it gives the name of player. but why wrote var playerNumber = 16 ; whereas, we have 3 different properties,