const mas = [1, 2, 134, 4, 13, 28, 35]
mas.sort((a, b) => console.log(a - b))
mas.sort((a, b) => a - b)
console.log(mas)
node /tmp/yFHimS8aFg.js
-1
-132
130
-9
-15
-7
[ 1, 2, 4, 13, 28, 35, 134 ]
compareFn(a, b) return value sort order
> 0 sort a after b
< 0 sort a before b
=== 0 keep original order of a and b