I need to create an array (observations) which contains arrays of eight numbers (named observation). These numbers should be in range between 0 and 9.
let observations = [];
let observation = [];
let min = 0;
let max = 9;
for (let i = 0; i < 20000; i++) {
for (let j = 0; j < 8; j++) {
observation[j] = Math.floor(Math.random() * (max - min + 1)) + min;
}
observations.push(observation);
}
Problem: The numbers are pseudo random and I get the same result 20 000 times.
Is there a possibility to fix this issue in JavaScript?