
JavaScript 使用变量访问对象属性
// 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
// 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
关闭