function cellArea(h3Index, unit) {
    const [lower, upper] = h3IndexToSplitLong(h3Index);
    const out = C._malloc(SZ_DBL);
    try {
        switch (unit) {
            case UNITS.m2:
                throwIfError(H3.cellAreaM2(lower, upper, out));
                break;
            case UNITS.km2:
                throwIfError(H3.cellAreaKm2(lower, upper, out));
                break;
            case UNITS.rads2:
                throwIfError(H3.cellAreaRads2(lower, upper, out));
                break;
            default:
                throw JSBindingError(E_UNKNOWN_UNIT, unit);
        }
        return readDoubleFromPointer(out);
    } finally {
        C._free(out);
    }
}
Exact area of a given cell
@static
@param  {H3IndexInput} h3Index  H3 index of the hexagon to measure
@param  {string}  unit     Distance unit (either UNITS.m2, UNITS.km2, or UNITS.rads2)
@return {number}           Cell area
@throws {H3Error}          If the input is invalid