I know that's function:
function myFunction() {
points.sort(function(a, b){return a - b});
is fully working for sorting array contain number in ascending..
If the result is negative a is sorted before b.
If the result is positive b is sorted before a.
If the result is 0 no changes are done with the sort order of the two values.
But how's the sequence for the compare "a" and "b" ? Is it "index0" compare "index1", then "index1" compare "index2", etc..? I just don't understand this "compare function" workflow/ sequence...