I know there are many many questions about sorting javascript arrays by multiple values, but none of the answers solved my problem.
I have an array of coordinates li
For each x,y pair, square x, square y and add together. Smallest number is nearest to the origin.
x,y