Skip to content

Commit

Permalink
make 0 default value if display is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
dwnorm2 committed Jan 27, 2024
1 parent 5973cfc commit cb5b91b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ document.querySelector(".decimal").addEventListener("click", function () {
showCurrentNum();
});

document.addEventListener(onclick, showCurrentNum());
showCurrentNum();

document.addEventListener("keydown", function (event) {
const key = event.key;
Expand Down Expand Up @@ -195,10 +195,10 @@ document.addEventListener("keydown", function (event) {
});

function showCurrentNum() {
display.textContent = calc.current;
display.textContent = !calc.current ? "0" : calc.current;
}

display.textContent = "0";
// display.textContent = "0";

//to do:
//create previous num variable and conditionals to work off of previous num
Expand Down

0 comments on commit cb5b91b

Please sign in to comment.