Good day. I have a mistake in the logic of storing the numbers, but i can't figure out why. In result, i need to have the correct answer like "1+1 = 2", instead i have "1+1 = 1".
And one more question is how to store a lot of operations, like "2 + 2 / 4 \* 1"?

I will be very appreciate for your help.

p.s. <https://codepen.io/Dmxvil/pen/MWyBqOz> (you can see the calculator here with html)

```js
const numbers = document.querySelectorAll('[data-calc]'),
    operators = document.querySelectorAll('[data-operator]'),
    prev = document.querySelector('.prev-result'),
    current = document.querySelector('.current-number'),
    //resetBtn = document.querySelector('.operator-btn-reset'),
    resultBtn = document.querySelector('[data-result]');

let prevData = [];
let currentData = [];
let operation,
computation;

    numbers.forEach((number => {
        number.addEventListener('click', () => {
            current.innerHTML = number.innerText;
            currentData.push(number.dataset.calc);
            current.innerHTML = currentData.join('');
        });
    }));

function updateDisplay(){
        prev.innerHTML = currentData.join('');
        prevData = prev.innerHTML;
        currentData.splice(0, 100);
        current.innerHTML = '';
}

function chooseOperator() {
    operators.forEach(operator => {
        operator.addEventListener('click', () => {
            operation = operator.innerText;
            switch (operator.innerText) {
                case '+':
                    console.log(operation);
                    computation = prevData + currentData;
                    console.log(computation);
                    break;
                case '-':
                    console.log(operation);
                    computation = prevData - currentData;
                    break;
                case '*':
                    console.log(operation);
                    computation = prevData * currentData;
                    break;
                case '/':
                    console.log(operation);
                    computation = prevData / currentData;
                    break;
            }

            updateDisplay();
        });
    });
}

chooseOperator();

function result(){
    prev.innerHTML = prevData + operation + currentData.join('');
    current.innerHTML = computation.toString();
}

resultBtn.addEventListener('click', ()=> {
    result();
});
```