function cellsToMultiPolygon(h3Indexes, formatAsGeoJson) {
    // Early exit on empty input
    if (!h3Indexes || !h3Indexes.length) {
        return [];
    }
    // Set up input set
    const indexCount = h3Indexes.length;
    const set = C._calloc(indexCount, SZ_H3INDEX);
    storeArrayOfH3Indexes(set, h3Indexes);
    // Allocate memory for output linked polygon
    const polygon = C._calloc(SZ_LINKED_GEOPOLYGON);
    try {
        throwIfError(H3.cellsToLinkedMultiPolygon(set, indexCount, polygon));
        return readMultiPolygon(polygon, formatAsGeoJson);
    } finally {
        // Clean up
        H3.destroyLinkedMultiPolygon(polygon);
        C._free(polygon);
        C._free(set);
    }
}
Get the outlines of a set of H3 hexagons, returned in GeoJSON MultiPolygon
format (an array of polygons, each with an array of loops, each an array of
coordinates). Coordinates are returned as [lat, lng] pairs unless GeoJSON
is requested.

It is the responsibility of the caller to ensure that all hexagons in the
set have the same resolution and that the set contains no duplicates. Behavior
is undefined if duplicates or multiple resolutions are present, and the
algorithm may produce unexpected or invalid polygons.

@static
@param {H3IndexInput[]} h3Indexes  H3 indexes to get outlines for
@param {boolean} [formatAsGeoJson] Whether to provide GeoJSON output: [lng, lat], closed loops
@return {CoordPair[][][]}          MultiPolygon-style output.
@throws {H3Error}                  If input is invalid