What is the best way to parse common data from an object and an array to get a specific value from the current data.
In this case I am looking at current_data[3] and dog_database.vets to see the output of current_data[4].
current_data = ['true', 'visiting-today', 'DVM-Wiessman','J-001'];
var dog_database = [
{"dog_name": "Joey", "chip_id": "001", "breed": "mixed", "vets":['DVM-Wiessman','DVM-White']},
{"dog_name": "Max", "chip_id": "002", "breed": "beagle", "vets":'DVM-Wiel'},
{"dog_name": "Izzy", "chip_id": "003", "breed": "mixed", "vets":'DVM-James'},
{"dog_name": "Frankie", "chip_id": "004", "breed": "terrier","vets":'DVM-Smith'},
{"dog_name": "Star", "chip_id": "005", "breed": "husky", "vets":['DVM-Johns','DVM-Pearson']},
{"dog_name": "Goku", "chip_id": "006", "breed": "lab", "vets":'undecided'},
];
//How I thought about approaching it in psuedocode
if(current_data[3] == dog_database.vets || dog_database.vets.includes(current_data[3])) {
console.log(current_data[4])
}
else{
console.log('does not exist');
}