Having trouble comparing two or multiple objects using the difference()
function and then extracting the object(s) key value to push into an array of URLs only. I'm facing an issue where I can't use dot syntax on an object, any ideas?
Here is the this.stores array:
[
{
name: "Google Play",
url: "https://play.google.com"
}
]
And this is the result array:
[
{
name: "Google Play",
url: "https://play.google.com"
},
{
name: "Steam Store",
url: "https://store.steampowered.com"
}
]
I am comparing these 2 arrays of objects in the following way:
const storesDifference = difference(result, this.stores);
// correctly returns 'Steam Store'
console.log('difference', storesDifference.url);
// Attempting to retrieve URL key using dot syntax but no luck