I have the following Javascript object:
var icecreams = [{
name: 'vanilla',
price: 10,
rating: 3
}, {
name: 'chocolate',
price: 4,
rating: 8
}, {
name: 'banana',
price: 1,
rating: 1
}, {
name: 'greentea',
price: 5,
rating: 7
}, {
name: 'moosetracks',
price: 6,
rating: 2
}, ];
I need to access the "related properties" (not sure of the exact terminology) in each section of the object. For example, if I am given the name "vanilla," I need to access a "price" of 10 and "rating" of 3. Is there a way to do this without changing the object's structure? Possibly using this?