I am in an introductory coding course and we have just begun learning about javascript. Our first assignment is to create a simple javascript calculator that is capable of computing the sum, average, max and min values of a list of numbers. My teacher says that this can be accomplished in a variety of ways but he recommends something called "for" loops. I am decent at css and html but I have been really struggling with javascript. Any help would be appreciated.
html:
<h4>1,3,9,6,5,7,12,32</h4>
<input type="text" id="valueList"><button type="button" id="calculate">Calculate Stats</button>
<br><br>
<H2>Results</H2>
<ul id="results"><!--javascript will write items here--></ul>
jss:
var valueSum = 0;
var valueAverage = 0;
var valueMax = 0;
var valueMin = 0;
$( "#calculate" ).click(processValues);
function processValues() {//listens for click event
$("#results" ).html( "" );//clears any list items from last calculation
var valueString = $( "#valueList" ).val();
var value = $.map(valueString.split(","), Number ); //this is an array
valueCount = value.length; //get the lenght of the array (number of values)
//
//Use a loop (or loops) here to help calculate the sum, average, max, and min of the values
//
$("#results" ).append( "<li>The values entered: " + valueString + ".</li>" );//appends values
$("#results" ).append( "<li>There are " + valueCount + " values.</li>" );//appends value count
//need to append Sum, average, max, and min to bullet list here
//clears text field for next set of values to be entered
$("#valueList").v