Book Image

TypeScript Essentials

By : Christopher Nance
Book Image

TypeScript Essentials

By: Christopher Nance

Overview of this book

Table of Contents (15 chapters)

Chapter 4. Object-oriented Programming with TypeScript

Object-oriented Programming (OOP) is a concept built into many languages that help associate data and methods together in a single construct. Objects are created and are able to interact with each other using one another's public facing methods. JavaScript itself is not an object-oriented language in the way that C++, C#, or Java are. The construct of closures, which we discussed earlier allows us to bring object-oriented concepts into JavaScript development. TypeScript on the other hand can be treated as an object-oriented language because of the language constructs it introduces on top of JavaScript closures. In this chapter, we will discuss each of the core concepts behind object-oriented programming and how TypeScript allows JavaScript to implement this paradigm. The topics that will be covered in the chapter are as follows:

  • SOLID

  • Inheritance

  • Encapsulation

  • Abstraction

  • Polymorphism