I am pulling data from an API that gives me an object of items, each containing a string named correct_answer
and an array named incorrect_answers
.
I am trying to combine those values within each item, so when I do v-for
, it will loop through the answers merged together in one loop. I also want to randomize the order of those answers.
An example of what the object looks like:
"results": [
{
"question": "Where was the Games of the XXII Olympiad held?",
"correct_answer": "Moscow",
"incorrect_answers": [
"Barcelona",
"Tokyo",
"Los Angeles"
]
},
{
"question": "What is the first weapon you acquire in Half-Life?",
"correct_answer": "A crowbar",
"incorrect_answers": [
"A pistol",
"The H.E.V suit",
"Your fists"
]
},
]