Typescript Function Overloading - Is It Good Enough?
Вставка
- Опубліковано 4 сер 2024
- Learn Typescript function overloading and how it works. It allows us to create multiple signatures for the function and only one implementation.
► CHECK MY COURSES - monsterlessons-academy.com/co...
MOST POPULAR COURSES
► Building real project with Angular + NgRx - monsterlessons-academy.com/co...
► Building real NestJS API - monsterlessons-academy.com/co...
► Javascript interview questions - monsterlessons-academy.com/co...
► Angular Interview Questions monsterlessons-academy.com/co...
► Building real fullstack project - monsterlessons-academy.com/co...
► Mastering Git - monsterlessons-academy.com/co...
► Mastering Docker and Docker Compose - monsterlessons-academy.com/co...
► Building real project with React Hooks - monsterlessons-academy.com/co...
► Building real project with Vue + Vuex - monsterlessons-academy.com/co...
FOLLOW ME
► TWITTER - / monster_lessons
► INSTAGRAM - / monsterlessonsacademy
► TIKTOK - / monsterlessonsacademy
Honestly if I wanted to save space in the params I think I'd just add a type property above and apply within there what I expect the function can use or return. But damn I love your videos!
Thank you!
Good to know, but not really usable. Even if you have the overloads you still have to implicitly check what is the parameter type.
Agreed!
I'd probably just use the non-overloading version, I think it looks simpler lol
Exactly. Most of the time I don't want to see this.
Looks like just syntax sugar :Ъ
Yeap