Brendan Moran13,756 Points
Another Solution -- Thoughts?
I wanted to show the user both the question and the answer, but for the incorrect answers, I also wanted to show them their answer alongside the correct answer. This required pushing their response to the correct/incorrect answer arrays, along with the question arrays, and the spread operator was necessary there. After that, the toughest part was figuring out a decent way to test if the loop was dealing with correct or incorrect answers. The most straightforward thing I could think to do this was to add a "tag" to the beginning of each array with simply the string value, "correct" or "incorrect", and then test for that in the loop. It was the least hacky way I could think of, trying to keep it relatively easy to read, concise, and dry. It turned out to be a simple solution, but is it OK practice?
nb: I have a function that is creating an entire ol, but there's no reason for that other than kicks and giggles. You could do the same thing with createListItems function.
Nasra IidFront End Web Development Techdegree Student 9,876 Points
The easies way I could thing of is to interpolation both question and answer
This will print both question and answer