Tell us what’s happening:
Describe your issue in detail here.
whats the use of using variables to acess object properties when we can use 1. Dot property accessor: object.property
and 2. Square brackets property access: object['property']
?? Please do explain
**Your code so far**
// Setup
const testObj = {
12: "Namath",
16: "Montana",
19: "Unitas"
};
// Only change code below this line
const playerNumber = 16; // Change this line
const player = testObj[playerNumber ]; // Change this line
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Accessing Object Properties with Variables
Link to the challenge: