ES6: Setters and Getters Clarification

After having some difficulty understanding how setters and getters work, I did some searching and found that, while it’s not explicitly stated, getters and setters are indirectly called (NEVER EXPLICITY IT SEEMS) when you use dot notation to:

(1) call an object property (which uses the getter), and

(2) modify or update the object property (which uses the setter)

This seems to be so obvious to most people who are explaining it that, I believe, something gets lost in the translation.

Here’s a YouTube video link that does a great job of explaining this in a little more detail: Getters and Setters in JavaScript - YouTube.

Hope this helps someone besides me!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.