# Stuck on getters setters

**URL:** <https://forum.kirupa.com/t/stuck-on-getters-setters/654142>\
**Category:** programming\
**Created:** [October 19, 2022, 6:21pm UTC](https://forum.kirupa.com/t/stuck-on-getters-setters/654142 "2022-10-19T18:21:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Groundhog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/groundhog/32/19164_2.png) [@Groundhog](https://forum.kirupa.com/u/Groundhog)\
**Post date:** [October 19, 2022, 6:21pm UTC](https://forum.kirupa.com/t/stuck-on-getters-setters/654142/1 "2022-10-19T18:21:58Z")

</div>

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’ .

 ![Screen Shot 2022-10-19 at 2.14.52 PM](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/0/2/02592d68d1a960b6a1ec29b3b12ec616b6b019a7.png)

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [October 19, 2022, 8:01pm UTC](https://forum.kirupa.com/t/stuck-on-getters-setters/654142/2 "2022-10-19T20:01:29Z")

</div>

You’re missing a comma (`,`) after your `get` function. 🙂

---

<div class="post-metadata">

**Author:** ![Groundhog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/groundhog/32/19164_2.png) [@Groundhog](https://forum.kirupa.com/u/Groundhog)\
**Post date:** [October 19, 2022, 8:21pm UTC](https://forum.kirupa.com/t/stuck-on-getters-setters/654142/3 "2022-10-19T20:21:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Groundhog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/groundhog/32/19164_2.png) [@Groundhog](https://forum.kirupa.com/u/Groundhog)\
**Post date:** [October 19, 2022, 9:14pm UTC](https://forum.kirupa.com/t/stuck-on-getters-setters/654142/4 "2022-10-19T21:14:27Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [October 19, 2022, 9:42pm UTC](https://forum.kirupa.com/t/stuck-on-getters-setters/654142/5 "2022-10-19T21:42:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Groundhog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/groundhog/32/19164_2.png) [@Groundhog](https://forum.kirupa.com/u/Groundhog)\
**Post date:** [October 20, 2022, 3:01pm UTC](https://forum.kirupa.com/t/stuck-on-getters-setters/654142/6 "2022-10-20T15:01:07Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [October 20, 2022, 4:31pm UTC](https://forum.kirupa.com/t/stuck-on-getters-setters/654142/7 "2022-10-20T16:31:31Z")

</div>

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