+ 6

🎓 can u explain this function ....>>>

function using in calculator ...... function displayValue (num) { document.calc.display.value = document.calc.display.value + num }

24th May 2017, 5:58 PM
#Happy@777
#Happy@777 - avatar
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
24th May 2017, 6:10 PM
MR Programmer
MR Programmer - avatar
+ 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.
24th May 2017, 6:07 PM
Rrestoring faith
Rrestoring faith - avatar