Below is an array of objects which I need to print in the below expected format only using forEach
in javascript
var donuts = [
{ type: "Dairy Milk", cost: 1.22 },//object
{ type: "Kit Kat", cost: 2.45 },
{ type: "Milky Bar", cost: 1.59 }
];
Expected output:
Dairy Milk cost $1.22 each
Kit Kat cost $2.45 each
Milky Bar cost $1.59 each
How do I do that?