From 03dcf7a6d869795222bc9947b115f9ada661814b Mon Sep 17 00:00:00 2001 From: lolabird Date: Wed, 27 Dec 2023 20:22:20 -0700 Subject: [PATCH] Get storage and operations working together properly --- script2.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/script2.js b/script2.js index 7fec622..1645c15 100644 --- a/script2.js +++ b/script2.js @@ -56,22 +56,21 @@ function displayOperator() { topScreen.textContent = result + " " + this.textContent + " "; } - mainScreen.textContent = result; + mainScreen.textContent = 0; inOps = true; } function displayNum() { - if (mainScreen.textContent == "0" || inOps) { + if (mainScreen.textContent == "0") { mainScreen.textContent = this.textContent; - inOps = false; } else { mainScreen.textContent += this.textContent; } - if (isNaN(topScreen.textContent) && isNaN(topScreen.textContent.charAt(-1))) { - topScreen.textContent += this.textContent; - } + // // if (isNaN(topScreen.textContent) && isNaN(topScreen.textContent.charAt(-1))) { + // // topScreen.textContent += this.textContent; + // // } }