DEV Community

All In Developer
All In Developer

Posted on Edited on Originally published at all1n.dev

🔀 TypeScript function overloading

TypeScript lets one function accept different arguments and return different types depending on how you call it. The syntax looks simple, but the rules about which signature wins and what callers actually see trip up almost everyone the first time.


👉 Continue reading on my blog: 🔀 TypeScript function overloading

Top comments (1)

Collapse
 
colinbradley profile image
Colin Bradley •

Nice - I didn't know about that!

I neatened up your example a little: diffchecker.com/FuL9OkcM