Convert array of arrays to array without duplicates
Adding all the elements to a Set should be generally the most efficient way. However, before you add them to the Set you are creating lots of intermediate arrays. It will likely be more efficient to just iterate over the elements and add them to the set one by one:
let set = new Set();
a.forEach(o =&gt; {
    o.items.forEach(i =&gt; {
        set.add(i.outerKey.innerKey);
    });
});
const finalArray = [...set];
console.log(finalArray);

Not sure if forEach() is the fastest way to iterate over the array elements in whatever runtime you are using. See here for a discussion of how to iterate arrays.