Skip to content

Commit

Permalink
fix result holdover bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelabelle committed Mar 28, 2024
1 parent 53fd72e commit bfd92ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,16 @@ inputs.forEach(button => {
secondNum = []
}
else if (button.classList.contains("number") && !operation) {
result = null
updateFirstNum(button)
currentDisNum = "first"
}
else if (button.classList.contains("number")) {
result = null
updateSecondNum(button)
currentDisNum = "second"
}
console.log({ firstNum, secondNum, result })
})
});

Expand All @@ -154,4 +157,5 @@ equals.addEventListener("click", e => {
firstNum = []
secondNum = []
screen.textContent = result
console.log({ firstNum, secondNum, result })
});

0 comments on commit bfd92ef

Please sign in to comment.