From c32dbed07c539d74f98b1969a3cf6f1d785a1fed Mon Sep 17 00:00:00 2001 From: joniboy74prog Date: Fri, 8 Dec 2023 04:33:38 +0100 Subject: [PATCH] =?UTF-8?q?enlever=20les=20grosses=20usines=20=C3=A0=20gaz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/fonctions.js | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/back/fonctions.js b/back/fonctions.js index fc09671..45bf103 100644 --- a/back/fonctions.js +++ b/back/fonctions.js @@ -156,22 +156,8 @@ function getImg2(categorie, indice){ // function for random index of a function - function getNextIndex(indicesArray) { - if (indicesArray.length === 0) { - // Si tous les indices ont été utilisés, réinitialiser le tableau d'indices - return null; // ou une autre valeur pour indiquer que tous les indices ont été utilisés - } - return indicesArray.shift(); - } - - const votreTableau = await getQuestionByCategorie2('transport'); - const shuffledIndices = createShuffledIndicesArray(votreTableau); - - // À chaque appel, récupérez le prochain indice - const premierIndice = getNextIndex(shuffledIndices); - const deuxiemeIndice = getNextIndex(shuffledIndices); - - console.log(premierIndice); // Indice aléatoire - console.log(deuxiemeIndice); // Indice différent + function getIndex(){ + + }