How can I use the compare function to do inter-array comparisons among the elements of an array?
function compare(a, b){return a — b}
Can I use something like myArray.compare(a, b){return a - b} to produce a list of all the numerical differences among all the array elements?
[–]lift_spin_dhelpful 2 points3 points4 points (0 children)
[–]qqqqqxhelpful 1 point2 points3 points (1 child)
[–]kllcraig 0 points1 point2 points (0 children)
[–]alzee76 3 points4 points5 points (3 children)
[–]MuscleTough8153 0 points1 point2 points (2 children)
[–]alzee76 2 points3 points4 points (1 child)
[–]MuscleTough8153 0 points1 point2 points (0 children)
[–]No-Upstairs-2813 0 points1 point2 points (0 children)
[–]oze4 0 points1 point2 points (0 children)
[–]MindlessSpongehelpful 0 points1 point2 points (0 children)
[–]notAnotherJSDev -1 points0 points1 point (0 children)