Если вы сохраняете que корректно answers
в массиве, а пользователь responses
в другом, где индексы массива сопоставляют ответы с ответами, вы можете использовать цикл для сравнения и подсчета правильных.
const answers = [
"Red Hot Chili Peppers",
"Rage Against The Machine",
"Nirvana",
"Sublime",
"The Black Keys",
"Dave Grohl",
"Pearl Jam",
"Big Gigantic"
];
let userResponses = [
"Red Hot Chili Peppers",
"Pink Floyd",
"Nirvana",
"Sublime",
"The Black Keys",
"Bob Marley",
"Pearl Jam",
"Artic Monkeys"
];
let goods = 0;
userResponses.forEach((x, idx) =>
{
goods += (x === answers[idx]);
});
console.log("Corrects: " + goods);
console.log("Incorrects: " + (answers.length - goods));