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

@omarnationalfleet assuming they these are input elements, you have to use its value property:

Number($w("#userLat").value)

etc…