上QQ阅读APP看书,第一时间看更新
Understanding interfaces, classes, and generics in TypeScript
Object-Oriented Programming (OOP) is a very old programming concept, used in languages such as Java, C#, and many others.
One of the advantages of using TypeScript is being able to bring some of these concepts into your JavaScript web applications. In addition to being able to use classes, interfaces, and more, we can easily extend import classes and import modules, as we will see in the coming examples.
We know that using classes in pure JavaScript is already an option, with the use of ECMAScript 5. Although it is similar, there are some differences; we will not address them in this chapter, so that we do not confuse our readers. We will only focus on the implementations adopted in TypeScript.