Hope you’re all well during these times,
Link to Javascript Meal Maker Project: https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-javascript-syntax-part-ii/modules/fecp-learn-javascript-syntax-objects/projects/meal-maker
Experiencing a problem with my ${main} template literal below.
generateRandomMeal() {
const appetizer = this.getRandomDishFromCourse('appetizers'); //Stores a random appetizer.
const main = this.getRandomDishFromCourse('mains');
const dessert = this.getRandomDishFromCourse('desserts');
const totalPrice = appetizer.price + main.price + dessert.price; //Stores total price of randomly generated meal.
return `YOUR RANDOM MEAL \n\nRandom Appetizer: ${appetizer.name} \nRandom Main: ${main} \nRandom Dessert: ${dessert.name} \n\nTotal Cost: £${totalPrice}`;
},
In the console, why does ${main} output [object, object] rather than for example {name: ‘meal name’, price: 10} ?.
Thanks in advance .