const array_combine = (arr1, arr2, key) => {

  // Combine both arrays

  const combinedArray = [...arr1, ...arr2];

  // Use reduce to group objects by the unique key

  const reduced = combinedArray.reduce((acc, current) => {

    const keyValue = current[key];

    // If a value with this key already exists, merge it, otherwise, add it

    acc[keyValue] = acc[keyValue] ? {

      ...acc[keyValue],

      ...current

    } : {

      ...current

    };

    return acc;

  }, {});

  // Return the values of the resulting object as an array

  return Object.values(reduced);

};