Matt Pocock’s Post

View profile for Matt Pocock, graphic

Author of Total TypeScript

switch(true) just got a whole lot better in TS 5.3. It's gone from basically unusable in TS to being a viable alternative to long if statements.

Usman Abdur Rehman

Tech Lead and Software Dev Content Creator.

1y

V nice. We had to use as everywhere in our project inside those cases. Will it work with instanceof as well?

Like
Reply

Both of them have a fallthrough 🥲

Lucky Jain

SDE 1 @ HighLevel. Ex-Leadsquared. React.js | Typescript | Vue.js | Nest.js | Kubernetes| Google Cloud

1y

Great. Gonna use it

Like
Reply
Daniel T.

Senior Full Stack Developer @evozon

1y

Quite interesting and it's great that we have this option also, but I still prefer the `if` pattern more (at least for now). Thanks Mateusz Burzyński!

Muhammad Abubakar

Frontend Engineer (React TypeScript)

1y

Matt Pocock, what font family is this?

Krystian Z.

人生に涙あり。

1y

Nice. 🤗

Like
Reply

Makes sense! Good one Matt. 

Like
Reply
See more comments

To view or add a comment, sign in

Explore topics