массив объектов JavaScript содержит
if (vendors.findIndex(item => item.Name == "Magenic") == -1) {
//not found item
} else {
//found item
}
Frail Fox
if (vendors.findIndex(item => item.Name == "Magenic") == -1) {
//not found item
} else {
//found item
}
vendors.filter(function(vendor){ return vendor.Name === "Magenic" })
const john = {
'name': 'John Doe',
'email': 'john.doe@example.com'
};
const jane = {
'name': 'Jane Doe',
'email': 'jane.doe@example.com'
};
const list = [john, jane];
let result = list.includes(john);
console.log(result); // true
var obj = {a: 5};
var array = [obj, "string", 5]; // Must be same object
array.indexOf(obj) !== -1 // True
const magenicVendorExists = vendors.reduce((accumulator, vendor) => (accumulator||vendor.Name === "Magenic"), false);