meta_pixel
Tapesearch Logo
Log in
Syntax - Tasty Web Development Treats

TypeScript Fundamentals × Narrowing, Discriminating Unions, and Type Guards

Syntax - Tasty Web Development Treats

Wes Bos

Tech News, News, Technology

4.91.2K Ratings

🗓️ 9 May 2022

⏱️ 23 minutes

🧾️ Download transcript

Summary

In this Hasty Treat, Scott and Wes talk about TypeScript Fundamentals, including narrowing, discriminating unions, and type guards. Sentry - Sponsor If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting Sentry.io and using the coupon code TASTYTREAT during sign up. Payments Hub - Sponsor There are hundreds of payments processing companies out there. Hit up developer.paymentshub.com/syntax to learn more about how Payments Hub Developers not only processes ecommerce and in-person payments, but also boards and underwrites your merchants in as little as 90 minutes. We are currently offering Syntax listeners who become new partners 6 months free data through our Business Reporting API! Show Notes 00:24 Welcome 01:35 Sponsor: Sentry 02:23 Sponsor: Payments Hub 05:21 Intro to TypeScript fundamentals 06:28 What is Type Narrowing? 09:32 typeof 11:58 instanceof 13:29 Custom typeguards 16:12 this is 17:59 discriminated unions Tweet us your tasty treats Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

Transcript

Click on a timestamp to play from that location

0:00.0

Monday. Monday. Monday. Open wide dev fans. Get ready to stuff your face with

0:07.0

JavaScript CSS. Node modules. Barbecue tips. Get workflow. Break dancing. Soft skills.

0:12.0

Web development. The hastiest. The craziest. The tastiest. Web development

0:17.0

treats. Coming in hot. Here is Wes Barakuda. Boss and Scott El Torro Lugo.

0:24.0

Tolinsky.

0:27.0

Welcome to syntax on this Monday hasty treat. We are going to be talking about some

0:35.0

TypeScript fundamentals. We're going to be talking about what is called type

0:39.0

narrowing, discriminating unions and typeguards. Basically, we're going to be helping

0:45.0

you solve some of those errors that pop up in your TypeScript code that make you

0:49.0

very frustrated because you say, hey, this thing is supposed to be this thing.

0:53.0

Why is it giving me an error? My name is Scott Linsky. I'm a developer from Denver,

0:56.0

Colorado. And with me, as always, is Wes Boss.

1:00.0

Can you narrow?

1:03.0

Is that Simpsons?

1:05.0

I don't know. I've never heard that collection of words in that melody.

1:10.0

Can you narrow? There's another guy there.

1:12.0

Oh, can you narrow? Yes. Oh. Yeah.

1:15.0

Yeah, that kind of kind of says Simpsons to me.

1:20.0

Oh, that's a good one. Simpsons, I don't do very many Simpsons jokes,

1:24.0

but that one came out a left field.

1:27.0

It did. It did. Might be out of left field.

1:29.0

What didn't come out of left field, Wes, is our two sponsors today,

...

Please login to see the full transcript.

Disclaimer: The podcast and artwork embedded on this page are from Wes Bos, and are the property of its owner and not affiliated with or endorsed by Tapesearch.

Generated transcripts are the property of Wes Bos and are distributed freely under the Fair Use doctrine. Transcripts generated by Tapesearch are not guaranteed to be accurate.

Copyright © Tapesearch 2026.