I have made a random quiz through javascript and HTML, the questions are in a JSON file, but when I run the quiz it repeats some of the questions multiple times, how do I make it that no questions are repeated.
function renderQuestion(){
let index = Math.floor(Math.random() * availableQuestions.length);
runningQuestion = availableQuestions[index];
availableQuestions.pop(index);
let q = questions[runningQuestion];
question.innerHTML = "<p>"+ q.question +"</p>";
qImg.innerHTML = "<img src="+ q.imgSrc +">";
choiceA.innerHTML = q.choiceA;
choiceB.innerHTML = q.choiceB;
choiceC.innerHTML = q.choiceC;
}