Stuck on getters setters

I took a piece of Absolute Beginner’s Guide, chapter 17 on getters/setters and tried to run it. What-the-hey? unexpected token ‘set’ .

You’re missing a comma (,) after your get function. :slight_smile:

omg. Thanks :sweat_smile:. Right, it’s another property of the object!

Then I found another error – but fixed that myself! I had
message = “HELLO!”,

instead of

message : “HELLO!”,

So now it’s all good. What a great place to ask a (stupid) question!


JavaScript is hard with a lot of confusing parts! There is no such thing as a stupid question, but that is especially true with JavaScript haha.

I am really enjoying your book - I like how you introduce some complication early on, and resolve it in subsequent chapters. I used to code in COBOL, trying to stay current by taking courses in C++, Perl, Java (but never working in them). Now that I am retraining myself (better late than never) for the 21st century, your book is the gateway for me to crack the more technical books, now that my memory of Classes and Objects is coming back. prototypical inheritance model, indeed :slightly_smiling_face:

1 Like

Great to hear that you are enjoying the book so far! :slight_smile: