TypeScript Classes Tutorial | TS for Beginners Lesson

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

In this Typescript Classes tutorial, you will learn how to create and extend classes, implement interfaces, apply visibility modifiers, use static class members, and create getters and setters in TS classes.

🚀 Become a full-stack web dev with Zero To Mastery Courses:

👇 Follow Me On Social Media:

TypeScript Classes Tutorial | TS for Beginners Lesson

(00:00) Intro
(00:05) Welcome
(00:28) Starter Code
(01:06) Basic Class
(02:34) Larger Class
(04:23) Visibility Modifiers
(06:24) Definite Assignment Assertion Operator
(07:22) Private & Protected Examples
(10:26) Compiling & Running Code
(12:02) Extends for Subclasses
(16:28) Implements for Interfaces
(20:31) Static Class Members
(24:52) Getters & Setters

Corrections:
(06:16) Optional: Assignments in the body of the constructor are not necessary at this point either. It is not an error if you choose to do so, but it is not required.

📚 Suggested Pre-requisites for this Typescript course:

📚 Tutorial References:

⚙ Web Dev Tools:

Was this Typescript Classes tutorial helpful? If so, please share. Let me know your thoughts in the comments.

#typescript #classes #interface
Рекомендации по теме
Комментарии
Автор

I wanted to take a moment to express my heartfelt gratitude for the incredible work you do on your YouTube channel. Your dedication to sharing valuable information and insights with the community is truly remarkable.
Your videos have been an invaluable resource for me and countless others. Your clear explanations, practical tips, and willingness to share your knowledge for free have made a significant impact on our learning journeys.
Your passion for what you do shines through in every video, and it's evident that you genuinely care about helping others succeed. Your generosity in sharing your expertise has not gone unnoticed, and I can't thank you enough for the time and effort you invest in creating such high-quality content.
Please know that your work is deeply appreciated, and it has made a positive difference in my life. I look forward to every new video you release, knowing that I will continue to learn and grow thanks to your guidance.
Keep up the fantastic work, and please know that you have a community of grateful learners supporting you every step of the way.

Leothebests
Автор

guy you're killing me with these typescript series!! Thank you. 🤟

Yarkaha
Автор

keep striving for progress over perfection ... and I think it is the only thing we should do in web dev, thank you

hosamgnaba
Автор

I love your way of explanation!
Thank you a million, Mr. Dave!

faris.abuali
Автор

Good tutorial. Clear and to the point. Please use semi-colons to close code, so new users are not learning bad coding habits.

ronaldram
Автор

Absolutely brilliant Teaching with Perfect Examples...No need to look up for 1000 videos...Just watching this and feeling Proud.😄

-cs
Автор

Hey, Dave, I don't know if you will see this comment or not but I really hope that you will see it one day, I'm grateful to you for this masterpiece playlist, I was planning to leave a comment for you at the end of the playlist of Typescript but I couldn't wait because you really made OOP piece of cake and with your explanation and simple notice such as super() should come before assigning anything else, it's so simple to notice but you even mentioned it and these simple notes really make difference between some just make a video and some wanna deliver a message and teach somebody real thing, and for the record, I left a comment on next course that I wish if it was with JS so I decided to give Typescript a shot and it was the right call. I thank you again from my heart for this tremendous effort and wish you all luck with this excellent channel. ♥♥

ahmedtakeshy
Автор

according to TypeScript docs / Parameter Properties
Unless we want to do something with the params there is no need to re-assign them to the properties in the constructor body.

Thanks Dave and have a nice day/evening

ahmad-murery
Автор

This is a superb tutorial. Thank you dear, Mr. Dave.

qazimtahir
Автор

really I would like to think you for the incredible efforts you made, it has been a while since my last revision to classes, and in addition to typescript you did great work to review class, inheritance and difference between private, protected and static ... impressive and thank you very much

oussemabouyahia
Автор

Thanks man I will be sure to watch this after I perfect react

abdulrahmanagboolaosho
Автор

I've learned a lot Thanks a million Dave!

kk
Автор

Dave's videos are the best! Thanks, Dave.

Jerry-xycg
Автор

Amazing explanation ever, thank you so much for such quality work- tutorials!

Ninnja
Автор

Always strive to learn from your content. Tonnes of thank you. Love from India. 🙏

dhavalvanjara
Автор

It would be beneficial to differentiate that public/protected/private keywords are TypeScript constructs (even though modern js has proper #private members now) while static keyword is a js construct for the uninitiated.

case
Автор

Hi there,
Dave could you explain why you put `return` on line 112. It looks extra to me because if `if` condition is true `else` condition will not execute even without `return`.

adilnurkaliyev
Автор

Great tutorial as always!
I was also wondering about the code repetition as for the class properties. The workaround you mentioned seems only to work when the constructor takes in these properties, not when I create them independently in the constructor body.
So it seems that in many cases we cannot get rid of this code repetition. :/

ScriptRaccoon
Автор

Thank you so much dave can you please do a small MERN with type script

omarakki
Автор

good explanations, keep going to share knowledge

dzhaniivanov