aematsus / Meal-Maker

Project to enforce Learning about Objects and Properties, Getters and Setters, etc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError

aematsus opened this issue · comments

This is what the console brings up but I can find whats wrong with the 'price' variable. Its located on line 35. I am not sure how to solve this. I googled the error type and it said that 'price' may not be defined but I believe it is again on line 35. How should I solve this?

/home/ccuser/workspace/learn-javascript-objects-meal-maker/app.js:48
const totalPrice = appetizer.price + main.price + dessert.price;
^

TypeError: Cannot read property 'price' of undefined
at Object.generateRandomMeal (/home/ccuser/workspace/learn-javascript-objects-meal-maker/app.js:48:31)
at Object. (/home/ccuser/workspace/learn-javascript-objects-meal-maker/app.js:69:17)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)