December 2017
Beginner
372 pages
10h 32m
English
Encapsulation is one of the key pillars of object-oriented programming, which states that objects of a function should only expose required members to external code and hide the implementation details. With encapsulation, we provide a flexibility to the system to change its implementation without changing the contract. TypeScript provides encapsulation through the concept of classes, modules, and access modifiers. Classes are like containers which contain common features. Classes expose only the required fields using access modifiers such as private/public/protected. Modules are the containers of classes and provide another level of encapsulation for the group of classes achieving specific functionality:
class News{ public channelNumber ...Read now
Unlock full access