I completed all of my code, my problem is the end result. For some reason, my code is consoling to the log backwards. It reads “Today’s meal is 7 for $Sushi!”, when it should read “Today’s meal is Sushi for $7!”. I even went through the solution video and the result on that is right.
My code is inserted below:
const menu = {
_menu: “”,
_price: 0,
set meal(mealToCheck) {
if (typeof mealToCheck === “string”) {
return (this._meal = mealToCheck);
}
},
set price(priceToCheck) {
if (typeof priceToCheck === “number”) {
return (this._price = priceToCheck);
}
},
get todaysSpecial() {
if (this._meal && this._price) {
return Today's meal is ${this._meal} for $${this._price}!
;
} else {
return Meal or price was not set correctly!
}
},
};
menu._price = “Sushi”;
menu._meal = 7;
console.log(menu.todaysSpecial);