I have an array of objects that I use for a materials table datasource. I need to see if this row already exists in the datasource array before adding it.
There is no key value in this array. So I need to check if all items are unique
var datasource = [
{ Name: Jon, Address: 123 something }, {Name: Tyler , Address: 333 Something}
]
var rowtoAdd = [
{ Name: Jon, Address: 123 something }
]
const found = datasource.find(x => x.name == rowtoAdd.Name && x.Address == rowtoAdd.Address)
Is there a better way?