我正在尝试设置一个小问题/答案测验,我想知道这是否是一个很好的方法 -
我应该把它作为一个对象数组吗?
export const questions = [
{
question: "What is the 2nd planet in our solar system?",
choices: [
"Earth",
"Saturn",
"Venus",
"Neptune"
],
answer: "Venus"
},
{
question: "True or False: Mars has four moons",
choices: [
"True",
"False"
],
answer: "False"
}
]
我将在我的应用程序中使用此功能来显示卡片和单选按钮以单击正确的答案。