TypeScript Tutorial #13 - Public, Private & Readonly

preview_player
Показать описание
Hey gang, in this TypeScript tutorial we'll talk about access modifiers on our class properties - private, public & readonly.

🐱‍👤🐱‍👤 JOIN THE GANG -
----------------------------------------
🐱‍💻 🐱‍💻 My Udemy Courses:

🐱‍💻 🐱‍💻 Course Files:

🐱‍💻 🐱‍💻 Other Related Free Courses:

🐱‍💻 🐱‍💻 TypeScript Docs:

🐱‍💻 🐱‍💻 The Net Ninja Community Boards:
Рекомендации по теме
Комментарии
Автор

I wish you discussed protected and static accessors here as well, but overall this is a great tutorial series you have delivered. Salute to you, sir!

shams_shimul
Автор

One of the best teacher on YouTube to learn web development. Thanks so much for the tutorial series.

Shakeel
Автор

Keyword *readonly* is not an access modifier. It is used to declare a constant whose value can be assigned at runtime. You can use any access modifier together, for example, *public readonly client: string* and assign value to it in the constructor.

karstr
Автор

5:40, I struggled a lot to find the logic behind these type of declarations, , , thanks a lotttt

chakrasactivation
Автор

intergration with react, redux or other ui libraries then this course will be perfect! <3

MrMangkokoo
Автор

Thank you from BRAZIL!! (we call 'Brasil' with "s" instead of "z")

thalyssonleite
Автор

What's next master?
Golang? Tensorflow?

mgr
Автор

Im thinking of going through all your videos on here this summer? how many total hours you think that would take?

wovasteengova
Автор

Why is it that you cant read 'details' outside the class, u if you use 'console.log(invoices)' you can still output it xD or is there not much u can do with just the collection of the whole?

Thanks in regards, great series!

Feranash
Автор

First of all, thank you very much for your awesome videos. The React Hook ones helped me understand those concepts much faster (and planning to watch Tailwind series next).
Regarding this example, you mentioned that fields could be overwritten if not indicated by read-only or private accessor, which is a very good point. However, it might be worth pointing out that the same can be said for the "format" method (as you would expect from any normal JS object). I guess we could only prevent that by having a read-only arrow function 🤔 ? Although, I agree that a better argument would be "use common sense and for the love of god do not overwrite methods" 😂
A TS Generic I find very useful for these kinds of use-cases is the Readonly<T> one, so you can have a plain object but with the ability to declare fields as read-only if you want to take the functional programming approach.
Anyways, thanks again for your videos with great explanations on various topics. It always amazes me how you keep up with the latest topics.

curious-noob
Автор

Why is it that we need the access modifiers in order to declare properties in the constructor? I don't often work with classes, so forgive me if this is an easy question.

TheDionysiac
Автор

Just finished your J.S. course on udemy, and I just want to say, freaking thank you so much I learned so much.

Ps. How come I never saw you at Piccadilly?

atomiccode
Автор

But still if I m trying to access the private property(details) at line 26 (Time stamp 5:22), it's still producing error! Can you solve this?!!

electroviper
Автор

Re Access Modifiers, C# Developers are going 😁
For those who don't, defaults are the other way around 😐

rsodeyi
Автор

typescript is like turning javascript to more like java

prasadkadu