function greatCircleDistance(latLng1, latLng2, unit) {
    const coord1 = storeLatLng(latLng1[0], latLng1[1]);
    const coord2 = storeLatLng(latLng2[0], latLng2[1]);
    let result;
    switch (unit) {
        case UNITS.m:
            result = H3.greatCircleDistanceM(coord1, coord2);
            break;
        case UNITS.km:
            result = H3.greatCircleDistanceKm(coord1, coord2);
            break;
        case UNITS.rads:
            result = H3.greatCircleDistanceRads(coord1, coord2);
            break;
        default:
            result = null;
    }
    C._free(coord1);
    C._free(coord2);
    if (result === null) {
        throw JSBindingError(E_UNKNOWN_UNIT, unit);
    }
    return result;
}
Great circle distance between two geo points. This is not specific to H3,
but is implemented in the library and provided here as a convenience.
@static
@param  {number[]} latLng1 Origin coordinate as [lat, lng]
@param  {number[]} latLng2 Destination coordinate as [lat, lng]
@param  {string}   unit    Distance unit (either UNITS.m, UNITS.km, or UNITS.rads)
@return {number}           Great circle distance
@throws {H3Error}          If the unit is invalid