Question: Javascript Define an empty array. Also create two functions: addNumber() reads a value from a text input field on the HTML document (id=num) and adds
Javascript
Define an empty array. Also create two functions: addNumber() reads a value from a text input field on the HTML document (id="num") and adds it at the end of the array. printInfo() outputs the amount of elements in the array to the console, then the average of their values. The HTML document has two buttons for calling the functions.
Example output:
The array has 10 elements.
The average of the values is 36.1
The output of the program must be exactly the same as the example output (the most strict comparison level)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
