Concatenate Arrays of Objects and Exclude Duplicates

function mergeUniqueObjects(array, items, key = 'id') {
    return array.reduce((accumulator, item) => {
        const duplicate = accumulator.find(i => item[key] === i[key]);
        if (duplicate === undefined) {
            accumulator.push(item);
        }
        return accumulator;
    }, items);
}