We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 423aee0 commit 572da3dCopy full SHA for 572da3d
index.js
@@ -2,6 +2,8 @@ const btns = document.querySelectorAll("[data-value]");
2
let screen = document.querySelector("[data-screen]");
3
const operators = document.querySelectorAll("[data-operator]");
4
const operatorRegex = /[\/*\-+]/;
5
+const ZERO = 0;
6
+const ZERO_DOT = '0.';
7
8
let data = [];
9
@@ -139,7 +141,7 @@ function insertClosingParenthesis(button) {
139
141
}
140
142
143
function handlingZeroFollowedByAdecimal(button) {
- if (Number(button) === 0 && screen.innerText.startsWith("0.")) {
144
+ if (Number(button) === ZERO && screen.innerText.startsWith(ZERO_DOT)) {
145
screen.innerText += button;
146
147
0 commit comments