Can someone please assist me with this task? I am creating an array that corresponds to specific question numbers.
var arrayCharge = [];
for (var i = 2; i <= 45; i++) {
arrayCharge.push(i);
}
I then utilize these numbers to display the respective question, answer, and click. Afterwards, I select a new value from the array using this method:
const randomQ = arrayCharge;
const random = Math.floor(Math.random() * randomQ.length);
This successfully loads a new question, but the array remains unchanged. I attempted the following approach:
var remQ = arrayCharge.indexOf(randomQ[random]);
arrayCharge.splice(remQ,1);
Unfortunately, this did not yield the desired outcome :-(
Thank you in advance for your assistance. Nicolas
Please find below the complete code for better understanding. Apologies for missing it earlier:
<!DOCTYPE HTML>
<!--
Hyperspace by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<!-- Rest of the code goes here -->