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

КОМЕНТАРІ • 8

  • @nick.h7566
    @nick.h7566 8 місяців тому

    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!

  • @ivelintodorov6075
    @ivelintodorov6075 11 місяців тому +2

    Good to know, but not really usable. Even if you have the overloads you still have to implicitly check what is the parameter type.

  • @juanmacias5922
    @juanmacias5922 11 місяців тому

    I'd probably just use the non-overloading version, I think it looks simpler lol

  • @MrKOHKyPEHT
    @MrKOHKyPEHT 11 місяців тому +1

    Looks like just syntax sugar :Ъ