Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Nour El-din El-helw
Nour El-din El-helw
8,241 Points

Setter and Getters?

What are setters and getters in javascript?

Joel Bardsley
Joel Bardsley
31,246 Points

In case you're not aware, the Object-Oriented JavaScript course has a section dedicated to Getters and Setters, which should give you a more detailed explanation than any of us could provide in this thread.

1 Answer

Getters and setters are methods on objects that allow you to access otherwise hidden attributes within the object.

Nour El-din El-helw
Nour El-din El-helw
8,241 Points

hidden attributes like what? I mean like how can an attribute be hidden?