I have an array of objects:
[
{
id: 1,
sku: 'aaaa'
},
{
id: 2,
sku: 'bbbb'
},
{
id: 3,
sku: 'cccc'
},
{
id: 4,
sku: 'aaaa'
}
]
How can I check that there are more than one element with the same sku
property existing in the array?
For example: I have to elements with the same prop sku
('aaaa') - and in this case I need to do something in other case - nothing