Your avgX() function needs reworking. In the loop below, the variable "times" (originally an array) is set to a new value (and possibly no value) each iteration of the loop. Shift returns a value from an array, not an array.
for (i=0; times.length > x; i++){
var times = times.shift(); }
Also, I'm not sure you've set up your number sort function correctly. See this and set up the numerical sort method exactly as shown.
And there may be other problems in the function - I'm sure you'll figure it out.![]()



Reply With Quote



Bookmarks