22 lines
498 B
Markdown
22 lines
498 B
Markdown
|
---
|
||
|
title: Accessing Object Properties with Variables
|
||
|
localeTitle: Accediendo a las propiedades del objeto con variables
|
||
|
---
|
||
|
## Accediendo a las propiedades del objeto con variables
|
||
|
|
||
|
Aquí hay una solución de trabajo en caso de que esté atascado:
|
||
|
|
||
|
```js
|
||
|
// 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
|
||
|
|
||
|
```
|