First project in Javascript: NearestNeighbor Calculator
Are you hoping for the arc length around a sphere or the Earth? What about going through the earth in a straight line? Currently your math solves the sphere but not Earth.
The earth has 2 radi that are used to solve the arc length.
R = √ [ (r1² * cos(B))² + (r2² * sin(B))² ] / [ (r1 * cos(B))² + (r2 * sin(B))² ]
B = Latitude
R = Radius
r1 = radius at equator
r2 = radius at the poles

But your Haversine method is otherwise correct =D