I have the following array:
const person = [
{ name: "John", surname: "Doe" },
{ name: "Jane", surname: "Williams" }];
I want to check if a match is equal to just one name from the array. I did the following:
match === person[0].name || match === person[1].name || match === person[3].name ? "Do something" : "Blank"
I'm looking for a better way to iterate through this array, because I don't know array length.