JS newbie – Setters
Hello! Long time ... 🫠
So why is this get function, when called at the end through console not printing Burger and 40?
The setters are called with these values before.
Part of codecademy js intro course
4 Replies
Now it returns
Today's Special is ${this._meal} for ${this._price}$.
there's two things. You're setting the properties directly, you should be using
menu.meal = 40;
without the _
, and you're trying to use a template string without using backticks.
see how the syntax highlighting picks up the variables in this version?... god damn!
Changing the ticks and everything works. I did string ticks first, then got an error message since Today's has a special sign, and then changed it to quotation marks, because that's worked before.
Easy one, this time. 😉
Thank you! 🙌
no problem, glad it was an easy fix 😄