function cellToChildren(h3Index, res) {
    // Bad input in this case can potentially result in high computation volume
    // using the current C algorithm. Validate and return an empty array on failure.
    if (!isValidCell(h3Index)) {
        return [];
    }
    const [lower, upper] = h3IndexToSplitLong(h3Index);
    const count = validateArrayLength(cellToChildrenSize(h3Index, res));
    const hexagons = C._calloc(count, SZ_H3INDEX);
    try {
        throwIfError(H3.cellToChildren(lower, upper, res, hexagons));
        return readArrayOfH3Indexes(hexagons, count);
    } finally {
        C._free(hexagons);
    }
}
Get the children/descendents of the given hexagon at a particular resolution
@static
@param  {H3IndexInput} h3Index  H3 index to get children for
@param  {number} res       Resolution of hexagons to return
@return {H3Index[]}        H3 indexes of children, or empty array for invalid input
@throws {H3Error}          If resolution is invalid or output is too large for JS