In this tutorial, we'll learn about Typescript Classes, implementing interfaces and much more. If you have questions, please join my Discord server where I answer questions and you can chat with other web dev students: discord.gg/neKghyefqh
I wanted to take a moment to express my heartfelt gratitude for the incredible work you do on your TH-cam 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.
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
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
I'd like to reference this part of the docs. I feel like I am missing something but I don't think you are saying my examples are incorrect. Thanks Ahmad!
@@DaveGrayTeachesCode Hello Dave, I have tried to include the reference more than once but YT keeps deleting my comment, this is my last attempt and I hope that the algorithm is stupid enough to let it go this time 😁 in the official website there is a link to the Handbook, under the classes sections, please find the Parameter Properties heading, Thanks youtube for understanding 😁
Thanks Ahmad! Yes, having more difficulty discussing here in the YT comments and preferring Discord more and more. Sorry to hear YT made it difficult to share. Thanks for pointing to the subheading I needed. I see their // No body necessary comment which they didn't really highlight in their paragraph above but it does appear to be optional. 😀 Always good notes my friend!
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. ♥♥
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.
I do not compare/contrast JS with TS most of the time. I do suggest my JavaScript for Beginners course as a pre-requisite for this series in lesson 1 and in the description. #private classes and static are covered there.
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`.
Good question! No, they are not the same thing. You can use visibility modifiers in your constructor parameters as I show in the tutorial with public, private, protected, etc. Visibility modifiers set the member visibility. Parameter properties are created by prefixing a constructor argument with one of the visibility modifiers. (Reference: www.typescriptlang.org/docs/handbook/2/classes.html#parameter-properties) While "Typescript Constructor Shorthand" is not referenced in the docs, I do believe it refers to the Parameter Properties as they do in this article: dev.to/satansdeer/typescript-constructor-shorthand-3ibd
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. :/
In this tutorial, we'll learn about Typescript Classes, implementing interfaces and much more. If you have questions, please join my Discord server where I answer questions and you can chat with other web dev students: discord.gg/neKghyefqh
I wanted to take a moment to express my heartfelt gratitude for the incredible work you do on your TH-cam 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.
Thank you!
guy you're killing me with these typescript series!! Thank you. 🤟
You're welcome!
Absolutely brilliant Teaching with Perfect Examples...No need to look up for 1000 videos...Just watching this and feeling Proud.😄
keep striving for progress over perfection ... and I think it is the only thing we should do in web dev, thank you
Yes, this is my daily reminder 💯🚀
Thanks Dave!
Have a nice day!
Welcome! You, too!
I love your way of explanation!
Thank you a million, Mr. Dave!
Glad you liked it!
Good tutorial. Clear and to the point. Please use semi-colons to close code, so new users are not learning bad coding habits.
Thanks! Semi-colons are a preference - not a bad habit in my opinion, but everyone has their own opinion on it for sure.
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
Thanks Mr. Gray
Welcome!
This is a superb tutorial. Thank you dear, Mr. Dave.
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
I'd like to reference this part of the docs. I feel like I am missing something but I don't think you are saying my examples are incorrect. Thanks Ahmad!
@@DaveGrayTeachesCode Hello Dave,
I have tried to include the reference more than once but YT keeps deleting my comment,
this is my last attempt and I hope that the algorithm is stupid enough to let it go this time 😁
in the official website there is a link to the Handbook, under the classes sections, please find the Parameter Properties heading,
Thanks youtube for understanding 😁
Thanks Ahmad! Yes, having more difficulty discussing here in the YT comments and preferring Discord more and more. Sorry to hear YT made it difficult to share. Thanks for pointing to the subheading I needed. I see their // No body necessary comment which they didn't really highlight in their paragraph above but it does appear to be optional. 😀 Always good notes my friend!
@@DaveGrayTeachesCode Sorry, I totally forgot about Discord 🤦♂
You're most welcome my friend 💯👍
Thanks man I will be sure to watch this after I perfect react
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. ♥♥
Thank you and good job for working on TypeScript! 🚀
@@DaveGrayTeachesCode Thank you for this great effort
Dave's videos are the best! Thanks, Dave.
Glad you like them!
I've learned a lot Thanks a million Dave!
Amazing explanation ever, thank you so much for such quality work- tutorials!
Always strive to learn from your content. Tonnes of thank you. Love from India. 🙏
Thank you and hello to India! 👋
Thank you, Dave
Welcome!
Thankyouuuuu. Great tutorials man. keep it up!!!
You're welcome!
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.
I do not compare/contrast JS with TS most of the time. I do suggest my JavaScript for Beginners course as a pre-requisite for this series in lesson 1 and in the description. #private classes and static are covered there.
Awesome tutorial thank you
You're welcome!
thanks
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`.
This might actually make me consider learning java.
good explanations, keep going to share knowledge
Thank you! 💯
Thank you so much dave can you please do a small MERN with type script
I will do more with TS in the future. Are there "small" MERN projects? 😀
@@DaveGrayTeachesCodeI think 😁 thanks dave
Nice tutorial!!!
Thank you!
congrats on 90k
Thank you so much 😀
I have a question: "member visibility"," Parameter Properties" and also "Typescript Constructor Shorthand" are the same thing???
Good question! No, they are not the same thing. You can use visibility modifiers in your constructor parameters as I show in the tutorial with public, private, protected, etc. Visibility modifiers set the member visibility. Parameter properties are created by prefixing a constructor argument with one of the visibility modifiers. (Reference: www.typescriptlang.org/docs/handbook/2/classes.html#parameter-properties) While "Typescript Constructor Shorthand" is not referenced in the docs, I do believe it refers to the Parameter Properties as they do in this article: dev.to/satansdeer/typescript-constructor-shorthand-3ibd
Top!!! Thank YOU 😊
Welcome!
Are member functions by default public?
Led Zeppelin it is cool!
🎸🤘🎸🤘
🔥Rock On!!
🎸🎸🎸
Wonderful video
Thank you!
hi, how do you get those different font color? do you use any extensions from vs code? thx for your video.
A quick short about my VS Code theme choice: th-cam.com/users/shortsdp4u1NNFhtE
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. :/
Thank you! True - it cannot always be avoided unless you want to pass in parameters. Good observation that I may not have clearly stated.
can someone explain me why should we always use this.name why not super.name
basically an object to write an object for an object lol
Really helped