JS: Removed unecessary, not working code

This commit is contained in:
NetMan 2024-01-14 00:57:31 +01:00
parent 1746e2437c
commit e85acb81f0
1 changed files with 17 additions and 16 deletions

View File

@ -28,11 +28,10 @@ function operate(equals) {
} }
function execute(operation) { function execute(operation) {
if (operation.equal) {
const result = operate(operation); const result = operate(operation);
if ("" in operation) {
console.log("BLANK IS HERE");
}
operation.a_b = !operation.a_b; operation.a_b = !operation.a_b;
operation.equal = false;
operation.operator = ""; operation.operator = "";
if (operation.a_b) { if (operation.a_b) {
operation.a = `${result}`; operation.a = `${result}`;
@ -40,6 +39,7 @@ function execute(operation) {
} }
console.table(operation); console.table(operation);
console.log(`Result: ${result}`); console.log(`Result: ${result}`);
}
} }
let operation = { let operation = {
@ -47,6 +47,7 @@ let operation = {
operator: "", operator: "",
b: "", b: "",
a_b: true, a_b: true,
equal: false,
} }
let equal = ""; let equal = "";
@ -57,20 +58,20 @@ function click(value) {
operation.a += value; operation.a += value;
} else { } else {
operation.b += value; operation.b += value;
operation.equal = true;
} }
} else if (value == "=") { } else if (value == "=") {
execute(operation); execute(operation);
} else { } else {
if (operation.operator == "") { if (operation.operator == "") {
operation.a_b = !operation.a_b; operation.a_b = !operation.a_b;
}
operation.operator = value; operation.operator = value;
} }
console.table(operation); if (operation.a_b) {
operation.operator = value;
if ("" in operation) {
console.log("BLANK IS HERE");
} }
}
console.table(operation);
} }
function generateGui() { function generateGui() {