I am working with an array of latitude and longitude coordinates and I am looking to use JavaScript or Typescript to calculate the distance in miles and feet between these points.
const latsLngs = [
{
lat: 40.78340415946297,
lng: -73.9714273888736,
},
{
lat: 40.778399767985704,
lng: -73.97915215083648,
},
{
lat: 40.7722899997727,
lng: -73.96842331477691,
},
{
lat: 40.76617966968189,
lng: -73.97769302913238,
},
{
lat: 40.76838985393672,
lng: -73.96147102901031,
},
{
lat: 40.781909380720485,
lng: -73.96636337825348,
},
];