Add calculator call to operator section
This commit is contained in:
parent
dce94d7165
commit
b23ce98b4e
1 changed files with 4 additions and 2 deletions
|
|
@ -13,7 +13,6 @@ function displayToScreen() {
|
|||
|
||||
console.log(screen.textContent)
|
||||
screen.textContent = calc.calculate(screen.textContent) + " ";
|
||||
console.log(typeof(screen.textContent))
|
||||
} else if (this.className == "clear") {
|
||||
//clear´
|
||||
} else {
|
||||
|
|
@ -22,7 +21,10 @@ function displayToScreen() {
|
|||
if (this.className == "operator") {
|
||||
for (let i = 0; i < screenContent.length; i++ ) {
|
||||
if (operators.includes(screenContent[i])) {
|
||||
//call calculator
|
||||
let calc = new Calculator;
|
||||
|
||||
console.log(screen.textContent)
|
||||
screen.textContent = calc.calculate(screen.textContent) + " ";
|
||||
console.log("An operator was pressed again")
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue