Skip to content

Commit 1792340

Browse files
committed
feat(HTML): add line of codes to if statement with condition buttonValue === = so as to switch from positive to negative value and back
1 parent 23e828f commit 1792340

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ btns.forEach((btn) => {
7878
try {
7979
const replacedArray = data.map((item) => (item === "x" ? "*" : item === "÷" ? "/" : item));
8080
let result = eval(replacedArray .join(""));
81-
console.log(result)
82-
8381
console.log(eval(replacedArray .join("")));
8482
displayResult(replacedArray, result);
8583
divideByZero(screen, result);
84+
data = [];
85+
data.push(result)
8686
} catch (e) {
8787
screen.innerText = `${e.name} press AC`;
8888
}

0 commit comments

Comments
 (0)