Hi, I was working on mitagating this issue, and I need to get clarity on the following question
when you refer to an array of objects as argument, do you mean an array of questions inside the questions object, because the object in the file has the key which is a singular key , so I would be getting all the question from each one , so it would [ " what is the chemical symbol for potassium", “What is the unit of electrical resistance” …], pass that into the function and return an question at a particular index
const questions = [
{
category: “science”,
question: “What is the chemical symbol for potassium?”,
choices: [“P”, “K”, “Pt”],
answer: “K”
},
{
category: “science”,
question: “What is the unit of electrical resistance?”,
choices: [“Ohm”, “Coulomb”, “Sievert”],
answer: “Ohm”
},
{
category: “geography”,
question: “What is the capital city of Australia?”,
choices: [“Sidney”, “Canberra”, “Wellington”],
answer: “Canberra”
},
{
category: “literature”,
question: ‘Who wrote “1984”?’,
choices: [“Ray Bradbury”, “Aldous Huxley”, “George Orwell”],
answer: “George Orwell”
},
{
category: “sport”,
question: “How many players are on a standard volleyball team?”,
choices: [“6”, “7”, “12”],
answer: “6”