Player number string?

Tell us what’s happening:
This just seems like madness. Why not just code:
var player = testObj[16];
What the point of the extra line?

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36.

Challenge: Accessing Object Properties with Variables

Link to the challenge:

to learn that you can use variables to access object properties

Okay.
20 characters characters?

This is actually one of those principles that does not seem to make any sense in small projects, but the minute you start working on projects with hundreds of lines of code, explicitly defining variables to be used as arguments, or indices becomes quite useful.

In fact, the linter freeCodeCamp contributors use to iron out best-practices, so-to-say, enforces that something like this is not allowed:

var someValue = funcReturnsOneOrZero(true);

And, instead must be:

var returnOne = true;
var someValue = funcReturnsOneOrZero(returnOne);

The above is just random code, but I recently came across an issue where I tried to do something similar to the first example, and needed to be more explicit.

It helps others who might read the code.