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
you can also use the Array.find feature of es6. the doc is here
Array.find
es6
return restaurants.find(item => { return item.restaurant.food == 'chicken' })