let powerups = {
"pizza":["You gained super strength!"],
"cupcake":["You gained super speed!"],
"goblin soup":["You turned into a goblin!"],
"the finger":["Nothing happened!"],
"pasta":["You are now super flexible!"]
};
我正在尝试通过此函数访问字典。
let foodOptions = ["pizza", "cupcake", "goblin soup", "finger", "pasta"]
function foodWheelManager(list) {
println("Spinning wheel.")
let food = foodOptions[Math.floor(Math.random()*foodOptions.length)];
println("You eat the " + food + ".");
println(powerups.food[0]);
println("Game over you won!");
}