DEV Community

Discussion on: Getters And Setters: What Are Getters And Setters In JavaScript ?

Collapse
 
parenttobias profile image
Toby Parent

This is excellent! I appreciate a good in-depth exploration of how getters and setters can be useful. Another neat advantage to them? When we JSON.stringify() our objects, whether constructors or factories, the functions in them are stripped away. But getters are not treated as functions, but as their returned type.

Collapse
 
ezinne_anne profile image
Ezinne Anne😎👩🏿‍💻

Yes, thank you for reading