There was a problem writing a calculator.
for (var i = 0; i < calcBtn.length; i++){ calcBtn[i] = calcBtn.innerHTML; calcBtn[i].onclick = function btnClick() { +this; console.log(typeof this); calcInput.value += this.innerHTML; } } It is necessary to convert the object obtained from the array at the clique into a variable of the Number type in order to perform the mathematical operation in the future.
typeof this displays the object, but + this does not convert, I can not understand why? Help please, who knows?
+this.innerHTML? - dirariacalcBtn[i] = calcBtn.innerHTML;- what does that do? Remove this line. - Igor