While looping through some XML using JQuery I am constructing a grouping of numbers. From those numbers I am trying to acquire which of the numbers is the largest. For some reason, it is returning NaN when I use the Math.max function. Each number is no larger than 6 digits at most.
JQuery Loop to Construct Grouping
var snewmileagegroup = 0;
snewmileagegroup = snewmileagegroup + ',' + parseFloat($(this).find('Mileage').text());
Now I taking the resulting variable and apply the Math.max function to it expecting the return of 65,000. Problem is that I am getting NaN returned back instead.
var nmg = Math.max(snewmileagegroup);
My suspicion is that I am not creating the collection of numbers correctly by concatenating ','. Any help will be greatly appreciated.