I have an array, I need to return a restaurant\'s name, but I only know the value of its \"food\" attribute (not it\'s index number).
For example, how could I return
for(var i = 0; i < restaurants.length; i++) { if(restaurants[i].restaurant.food == 'chicken') { return restaurants[i].restaurant.name; } }