shuffle http

master v0.0.2
Bel LaPointe 2023-04-07 14:01:52 -06:00
parent 0fd0981a39
commit 64e992c6b6
1 changed files with 12 additions and 0 deletions

View File

@ -37,6 +37,18 @@
map((key) => [
[key, knowledgebase[key]]
])
function shuffle(array) {
let currentIndex = array.length, randomIndex;
while (currentIndex != 0) {
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex--;
[array[currentIndex], array[randomIndex]] = [
array[randomIndex], array[currentIndex]];
}
return array;
}
shuffle(knowledgebase)
console.log(0, knowledgebase)
function passQuestion(form) {