function getHexagonEdgeLengthAvg(res, unit) {
    validateRes(res);
    const out = C._malloc(SZ_DBL);
    try {
        switch (unit) {
            case UNITS.m:
                throwIfError(H3.getHexagonEdgeLengthAvgM(res, out));
                break;
            case UNITS.km:
                throwIfError(H3.getHexagonEdgeLengthAvgKm(res, out));
                break;
            default:
                throw JSBindingError(E_UNKNOWN_UNIT, unit);
        }
        return readDoubleFromPointer(out);
    } finally {
        C._free(out);
    }
}
Average hexagon edge length at a given resolution
@static
@param  {number} res  Hexagon resolution
@param  {string} unit Distance unit (either UNITS.m, UNITS.km, or UNITS.rads)
@return {number}      Average edge length
@throws {H3Error}     If the input is invalid