In JavaScript the sort() method's default behaviour is to sort values in an array alphabetically.
To sort by number you have to define a numeric sort function (which is very easy):
...
function sortNumber(a, b)
{
return a - b;
}
numArray = numArray.sort(sortNumber);