Help with a code to calculate distance between 2 coordinates using Latitude and Longitude.

Still few comments:

  1. the dataset.onReady should be inside: $w.onReady(() => {/here/})
  2. When you pasted it, you missed the final }) . 3. (btw, no need to put the distance function call in parenthesis)