JS: Removed unecessary, not working code
This commit is contained in:
parent
1746e2437c
commit
e85acb81f0
17
script.js
17
script.js
|
@ -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}`;
|
||||||
|
@ -41,12 +40,14 @@ function execute(operation) {
|
||||||
console.table(operation);
|
console.table(operation);
|
||||||
console.log(`Result: ${result}`);
|
console.log(`Result: ${result}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let operation = {
|
let operation = {
|
||||||
a: "",
|
a: "",
|
||||||
operator: "",
|
operator: "",
|
||||||
b: "",
|
b: "",
|
||||||
a_b: true,
|
a_b: true,
|
||||||
|
equal: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
let equal = "";
|
let equal = "";
|
||||||
|
@ -57,21 +58,21 @@ 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() {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue