Mastering JavaScript Object-Oriented Programming
上QQ阅读APP看书,第一时间看更新

Chapter 3. Working with Encapsulation and Information Hiding

In this chapter, we will explore the relationship between encapsulation and information hiding, and we will see the different approaches to implement the visibility and accessibility of members of a JavaScript object. The following topics will be addressed in this chapter:

  • Public and private properties
  • Scope and closure
  • Techniques to protect private members
  • Getters, setters, and property descriptors
  • Property definition in ES6 classes