@@ -32,21 +32,21 @@ class Calculator {
3232
3333 compute ( ) {
3434 let computation
35- const prev = parseFloat ( this . previousOperand )
36- const current = parseFloat ( this . currentOperand )
35+ const prevs = parseFloat ( this . previousOperand )
36+ const currentt = parseFloat ( this . currentOperand )
3737 if ( isNaN ( prev ) || isNaN ( current ) ) return
3838 switch ( this . operation ) {
3939 case '+' :
40- computation = prev + current
40+ computation = prevs + currentt
4141 break
4242 case '-' :
43- computation = prev - current
43+ computation = prevs - currentt
4444 break
4545 case '*' :
46- computation = prev * current
46+ computation = prevs * currentt
4747 break
4848 case '÷' :
49- computation = prev / current
49+ computation = prevs / currentt
5050 break
5151 default :
5252 return
@@ -94,7 +94,9 @@ const allClearButton = document.querySelector('[data-all-clear]')
9494const previousOperandTextElement = document . querySelector ( '[data-previous-operand]' )
9595const currentOperandTextElement = document . querySelector ( '[data-current-operand]' )
9696
97- const calculator = new Calculator ( previousOperandTextElement , currentOperandTextElement )
97+ const calculator = new Calculator ( previousOperandTextElement , currentOperandTextElement ) ;
98+ const calc = users [ ] ;
99+
98100
99101numberButtons . forEach ( button => {
100102 button . addEventListener ( 'click' , ( ) => {
@@ -123,4 +125,4 @@ allClearButton.addEventListener('click', button => {
123125deleteButton . addEventListener ( 'click' , button => {
124126 calculator . delete ( )
125127 calculator . updateDisplay ( )
126- } )
128+ } )
0 commit comments