// Concat two arrays of objects and keep unique values // Values from arr1 will be kept if exist in arr2, comparison made on `key` // object {key: 1, label: '..', ....} const unique = [...arr1, ...arr2].filter( (item, index, self) => self.findIndex((t) => t.key === item.key) === index )