Typescript Functions | Basics Tutorial for Beginners

  Рет қаралды 18,197

Dave Gray

Dave Gray

Күн бұрын

Web Dev Roadmap for Beginners (Free!): bit.ly/DaveGrayWebDevRoadmap
In this Typescript Functions | Basics Tutorial for Beginners you will learn about TS Functions, parameters and return types along with optional params, default param values, type guards, type aliases and more.
🚀 Become a full-stack web dev with Zero To Mastery Courses:
- The Complete Web Developer: bit.ly/WebDevMaster
- Master the Coding Interview: bit.ly/FAANGInterview
- Junior to Senior Dev Roadmap: bit.ly/WebDevRoadmap-JrtoSr
🚩 Subscribe ➜ bit.ly/3nGHmNn
📬 Course Updates ➜ courses.davegray.codes/
❓ Questions - Please post them to my Discord ➜ / discord
☕ Buy Me A Coffee ➜ www.buymeacoffee.com/davegray
👇 Follow Me On Social Media:
Github: github.com/gitdagray
Twitter: / yesdavidgray
LinkedIn: / davidagray
🔗 All Resources for this Typescript Course: github.com/gitdagray/typescri...
🔗 Playlist for this Typescript Course: bit.ly/3GcNJ78
Typescript Functions | Basics Tutorial for Beginners
(00:00) Intro
(00:05) Welcome
(00:17) Type Aliases
(03:11) Literal Types
(06:07) Basic Functions
(07:29) Functions with no return value
(10:40) The function keyword
(11:58) Function Type Aliases
(14:06) Function Interface
(15:28) Optional Parameters
(18:10) Default Parameters
(21:39) Function with Rest Params
(25:21) The never type
(27:54) Using the never type
(30:25) Custom Type Guard
📚 Suggested Pre-requisites for this Typescript course:
🔗JavaScript for Beginners full course: • JavaScript Full Course...
📚 Tutorial References:
🔗 Typescript Official Website: www.typescriptlang.org/
🔗 Anders Hejlsberg, Creator of Typescript and C# Interview: dev.to/destrodevshow/typescri...
🔗 Stackoverflow Survey Results: survey.stackoverflow.co/2022/...
🔗 MDN - Static Typing: developer.mozilla.org/en-US/d...
🔗 MDN - Dynamic Typing: developer.mozilla.org/en-US/d...
🔗 MDN - Type Coercion: developer.mozilla.org/en-US/d...
⚙ Web Dev Tools:
🔗 Chrome Browser: www.google.com/chrome/
🔗 Visual Studio Code (VS Code): code.visualstudio.com/
🔗 Node.js & npm: nodejs.org/
🔗 Live Server VS Code Extension: marketplace.visualstudio.com/...
Was this Typescript Functions basics tutorial helpful? If so, please share. Let me know your thoughts in the comments.
#typescript #functions #tutorial

Пікірлер: 65
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
In this tutorial, we'll learn about Typescript Aliases, Functions, literal types and the never type. 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
@Scottni2
@Scottni2 Жыл бұрын
Awesome video Dave!! You are very quickly becoming my favorite web dev teacher on youtube!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Wow, thanks!
@alseynidiop8650
@alseynidiop8650 Жыл бұрын
This comes exactly at the time I am learning typescript, you become my favorite KZbin teacher.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Happy to hear that!
@insteresting
@insteresting 7 ай бұрын
Awesome tutorial as always!! I noticed that at 30:58, you could also return directly typeof value === 'number', without explicitly using the ternary statement and it would work fine as well.
@ahmad-murery
@ahmad-murery Жыл бұрын
Although I don't use it often, but once you get used to typescript it's hard to get back to regular JavaScript. 1:42 I think we can make use of the already declared type stringOrNumber like this: type stringOrNumberArray = stringOrNumber[] Thanks Dave,
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Absolutely! Applying one example to the next - good work my friend!
@andresbreuer
@andresbreuer Жыл бұрын
As always Dave... amazing series!! Thank you so much!!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you, Andres!
@k303k
@k303k 6 ай бұрын
very clear explanation and worth learning!
@annusingh4694
@annusingh4694 Жыл бұрын
Loving the Typescript series 💯
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@wisekid7488
@wisekid7488 Жыл бұрын
Good job Dave! Keep going! Thanx 🤝👍
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thanks, will do! 🚀
@mostafaentezami8951
@mostafaentezami8951 9 ай бұрын
Thank you for your excellent teaching method🙏
@MOJICA7257
@MOJICA7257 Жыл бұрын
Thanks Dave! 🙂
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome! 💯
@mariolazzari
@mariolazzari Жыл бұрын
This lesson is really full of useful tips: great job!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@sonamohialdin3376
@sonamohialdin3376 Жыл бұрын
Amazing tutorial thank you very much
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You are welcome!
@TravinskiyVladislav
@TravinskiyVladislav Жыл бұрын
Thank you, Dave
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@flowerofash4439
@flowerofash4439 Жыл бұрын
this is probably infinitely more easier than scrollling through typescript documentations, thank you sir
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You are welcome!
@aladdindesign9218
@aladdindesign9218 Жыл бұрын
So interesting.
@moneyfr
@moneyfr Жыл бұрын
Thank you for your work I really like your videos.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad you like them!
@rahmatyousefi8273
@rahmatyousefi8273 Жыл бұрын
Thank you
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome!
@natediaz406
@natediaz406 6 ай бұрын
When i see your these tuts , i feel ts is really need to use
@7doors847
@7doors847 Жыл бұрын
Yepppppp! More TS 🔥!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Right on!
@lahcenaouina
@lahcenaouina Ай бұрын
Hi dave thank u so much for effort u are from my fav yt , please can u do Java EE and Spring boot pleassse
@IramKahkashan
@IramKahkashan Жыл бұрын
Hi Dave, Thank you to provide such a precise and awesome tutorial, Tell me one thing plz in VS Code I want to view the basic code of .push function, how can I view the source code of .push function or any function just like useSate() hook function or any other hook?
@siddiqahmed3274
@siddiqahmed3274 Жыл бұрын
gold content👑❤️
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you, Siddiq! 🙏💯
@PavithranLion
@PavithranLion Жыл бұрын
Thanks sir🙏💕
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@reeteshvirous1359
@reeteshvirous1359 Жыл бұрын
As always 🔥
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@Grishopping
@Grishopping Жыл бұрын
Thank you DAVE day by day I am advancing with your excellent pedagogy of your videos... A query the end of this series of TYPSCRIPT videos will only cover javascipt or do you plan to extend it to use in REACT Jose Grillo greets you from Venezuela ESPAÑOL Gracias DAVE dia a dia voy avanzando con tus excelente pedagogia de tus videos... Una consulta el acande de esta serie de videos de TYPSCRIPT solo cubrira javascipt o lo piensas extender para usar en REACT Te saluda Jose Grillo desde Venezuela
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you, Jose! I will bring in some React before this series is finished 💯
@Grishopping
@Grishopping Жыл бұрын
@@DaveGrayTeachesCode Excelente muchas Gracias amigo DAVE
@LevPleshkov
@LevPleshkov Жыл бұрын
31:00 Why not just ``` return typeof value === 'number' ``` ?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Good point - here I go again being over-explicit 😆
@LevPleshkov
@LevPleshkov Жыл бұрын
@@DaveGrayTeachesCode Thanks, I think that's never a bad practice! I thought there might have been some 'gotcha' I didn't know about =D
@noSweatSuperDry
@noSweatSuperDry 10 ай бұрын
The lessons are great, but it would be great, if you gave us some problem in between to solve, which makes channel and viewers more interactive. But, thank you very much for your lessons.
@djumarong
@djumarong Жыл бұрын
it's redundant to use the ternary operator here: typeof value === 'number' ? true : false
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
I can be overly explicit at times. I would need to review the code to see the example or you could provide a timestamp.
@moneyfr
@moneyfr Жыл бұрын
can you do some small exercises to apply all that you teach us
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
This series has a couple of projects to pull everything together.
@loukhai
@loukhai Жыл бұрын
😊 ✌️ peace
@dzhaniivanov5837
@dzhaniivanov5837 Жыл бұрын
youtube algorithm
@DiegoBM
@DiegoBM Жыл бұрын
They shouldn't have allowed the interface with a method to be valid for a function signature... it sure looks hacky, counterintuitive, and hard to read
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Opinions vary on the usage of types and interfaces.
@DiegoBM
@DiegoBM Жыл бұрын
@@DaveGrayTeachesCode I definitely get the confusion when it comes to objects, but a type definition for a function signature based on interfaces truly feels unnatural (in my opinion, of course)
@kim92se64
@kim92se64 Жыл бұрын
watching 15 minutes
@Pareshbpatel
@Pareshbpatel Жыл бұрын
{2023-03-16}
@kenansari
@kenansari Жыл бұрын
Hey thanks its great content, i wonder you will merge it with React?(react+typescript)
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
I will add some React to this series before it is finished.
@kenansari
@kenansari Жыл бұрын
@@DaveGrayTeachesCode thank you for your help
@mikayilaliyev442
@mikayilaliyev442 Жыл бұрын
I get "Cannot find name 'createError'.ts(2304)" when I do return createError('something')
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Did you try the first result in Google? stackoverflow.com/questions/71918235/cannot-find-name-createerror-ts2304
Typescript Objects, Arrays, Tuples & Enums | Basics Tutorial
29:10
Super sport🤯
00:15
Lexa_Merin
Рет қаралды 19 МЛН
О, сосисочки! (Или корейская уличная еда?)
00:32
Кушать Хочу
Рет қаралды 7 МЛН
Generics: The most intimidating TypeScript feature
18:19
Matt Pocock
Рет қаралды 160 М.
the cleanest feature in C that you've probably never heard of
8:13
Low Level Learning
Рет қаралды 124 М.
JavaScript Functions Crash Course
1:36:54
freeCodeCamp.org
Рет қаралды 149 М.
React Typescript Tutorial for Beginners
28:24
Dave Gray
Рет қаралды 72 М.
TypeScript Generics are EASY once you know this
22:21
ByteGrad
Рет қаралды 120 М.
Typescript Generics | Beginners Tutorial with Examples
24:43
Dave Gray
Рет қаралды 16 М.
I Cannot Believe TypeScript Recommends You Do This!
7:45
Web Dev Simplified
Рет қаралды 158 М.
Super sport🤯
00:15
Lexa_Merin
Рет қаралды 19 МЛН