I have a javascript object like this, let's call it store:
{
area1: {my product name: 'red'}
}
I want to check if a specific value exists in store, using hasOwnProperty. Assuming that I have all these values already defined in properties, like area, productName and color, how can I check if store has a area property ans this one also has a productName property?
I basically would like to do something like
const res = store.hasOwnProperty(area[productName]) && store[area][productName]=== color;
which seems not to work.