By default the sort method sorts elements alphabetically.
To sort numerically just add a new method which handles numeric sorts
var points = [40, 100, 1, 5, 25, 10];
points.sort();
// [1, 10, 100, 25, 40, 5]
points.sort(function(a, b){return a-b})
// [1, 5, 10, 25, 40, 100]
points.sort(function(a, b){return b-a})