// Async Version
getDistanceByKilometers(
{ lattitude: 43.6426723, longtitude: 44.2531532 },
{ lattitude: 50.9483754, longtitude: 49.3948516 },
function (err, res) {
if (err) return err;
console.log(res);
}
);
// Sync Version
getDistanceByKilometersSync(
{ lattitude: 43.6426723, longtitude: 44.2531532 },
{ lattitude: 50.9483754, longtitude: 49.3948516 }
);
// Same code structure like above with names getDistanceByMiles and getDistanceByMilesSync
{
lattitude: number,
longtitude: number
}
const km = 2.4;
const miles = kilometers2miles(km);
const ml = 4.5;
const kilometers = miles2kilometers(ml);