+ 6
🎓 can u explain this function ....>>>
function using in calculator ...... function displayValue (num) { document.calc.display.value = document.calc.display.value + num }
2 ответов
+ 4
inside the document (body ).
there is. a form named as calc;
inside the form there is a textbox (any input element) which has a name display
we are access the value by
document.calc.display.value
and we add num on it
+ 2
The function just increases the value of the display of the calc object by num. num is just a variable accepted in the parameters of the function.
Using += might improve read-ability for long lines such as this one.