TypeScript Basics 14 - Inheritance and Polymorphism In TypeScript

preview_player
Показать описание

In this lesson, we'll learn how inheritance and polymorphism work in TypeScript. Create multiple classes that extend the same base class and use polymorphism to access those instances.

Course: TypeScript Basics
Learn about the basics of TypeScript. Understand how types work, how to use arrays and tuples, how to declare classes and interfaces. Understand concepts of type erasure, duck typing, enums, generics and modules. Create a development workflow and configure the TypeScript compiler to your needs. And watch as I build an end-to-end TypeScript application from scratch.
Рекомендации по теме
Комментарии
Автор

So much similarity with Java, such a relief.

alexop
Автор

Hi Koushik,

Thanks for all the great courses. I feel much confident after going through your tutorials. I have a query w.r.t. this tutorial and would really appreciate your response. I did inheritance in typescript as in this video and then went on to check the corresponding transpiled JS code for that. I found to my surprise that the inheritance done in JS code is much different than what I understood from your JavaScript inheritance tutorial where = parentClass.prototype was sufficient to create inheritance chain. I would be extremely grateful to you if you help us with a connect between the two logic. Always a great admirer of you :)

Best,
Rahul

rahulagarwalvlogging
Автор

How nice to find the same concepts here as in Java

hyperborean
Автор

Hi Koushik, ty, your videos so helpful

vahidsaebi
Автор

In the polymorphism example, are we typecasting aProgrammer object to be of type Person instead of Programmer ?

iosaroj
Автор

Great TypeScript videos.  Thank you for your impressive efforts. If you don't mind a question, what are your settings.json for  ?

GrayCo
Автор

in C# or any c language if base class is holding instance of derived class, when we make a call for same method name it would execute from base class method. i think its different in typescript

mendarkbabu
Автор

Such amazing content!! Thanks so much!!

pablokatt
Автор

JavaScript also has class data sturcture

husniddinqurbonboyev
Автор

"Programmers are people after all"
You're not fooling anyone bro

kaykostadinov
Автор

1:25 When you side programmers are people after all. 😅😅

rohitsharma-xtqe
Автор

There IS inheritance in javascript, and way more elegant than typescript or other OOP type inheritance. it is so simple that people think it is wrong to use it. Why? The funny thing is people think that TS is a strongly typed language, thus more reliable than loosely typed JS. They forget that every typescript at the end must be transpiled into javascript, which simply ignores types. Funny how programmers love to make their life harder.

adriatic