From 7e7d8d6504738f00b4f7490e62312f363a3271b1 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 31 Mar 2021 18:24:42 +0200 Subject: [PATCH] commente le spam dans la console --- js/main.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/js/main.js b/js/main.js index d75658f..d1dece7 100644 --- a/js/main.js +++ b/js/main.js @@ -64,17 +64,17 @@ const parseLogicalExpression = (subject = Object, expression = String) => { const gate = (gate = String, array = Array) => { let posGate = array.findIndex(element => typeof element == "string") if(array[posGate] == gate) { - console.log("je vais travailler avec la porte", gate, "sur", array); - console.log("je fais,", array[posGate - 1], gate, array[posGate + 1]) - if(gate == "&&") array[posGate + 1] = array[posGate - 1] && array[posGate + 1]; + // console.log("je vais travailler avec la porte", gate, "sur", array); + // console.log("je fais,", array[posGate - 1], gate, array[posGate + 1]) + if(gate == "&&") array[posGate + 1] = array[posGate - 1] && array[posGate + 1]; else if(gate == "||") array[posGate + 1] = array[posGate - 1] || array[posGate + 1]; else return console.error("bad gate type"); - console.log("res:", array[posGate + 1]); + // console.log("res:", array[posGate + 1]); array.splice(posGate - 1, 2); - console.log("finit:", array); - } else console.warn("la porte", gate, "n'a pas la priorité de calcule", array); + // console.log("finit:", array); + } // else console.warn("la porte", gate, "n'a pas la priorité de calcule", array); - console.log("\n "); + // console.log("\n "); return array; }; @@ -106,19 +106,17 @@ const parseLogicalExpression = (subject = Object, expression = String) => { // -> on retire les string vide arrayLogicalExpression = arrayLogicalExpression.filter(element => element != ""); - console.log(arrayLogicalExpression); + // console.log(arrayLogicalExpression); // on remplace par les valeurs de subject replaceWithRightValues(subject, arrayLogicalExpression); // on supprime les parenthèses - console.log("avant bracket calculator:", arrayLogicalExpression); arrayLogicalExpression = bracketCalculator(arrayLogicalExpression); - console.log("apres bracket calculator:", arrayLogicalExpression); // on résoud les problemes resolution(arrayLogicalExpression); - console.log("resultat final:", arrayLogicalExpression); + // onsole.log("resultat final:", arrayLogicalExpression); return arrayLogicalExpression[0]; };