@nicm42
Posted
This all looks great.
There are different ways of doing loops, but there's nothing wrong with the for loop. And not all the others will work with querySelectorAll, because JS is fun like that. MDN's page about querySelectorAll gives an example of forEach (which is a loop but doesn't look like it) so if you wanted you could go down a rabbit hole looking that up and trying to understand it.
There's a couple of other ways to make an accordion. One is to make each of them a checkbox, use CSS to hide the checkbox, and use JS to show the answers if the checkbox is checked. There are also the HTML tags details and summary, which will make an accordion without JS (but that's less useful if you want to practise your JS!)