logo
episode-header-image
Sep 2021
17m 35s

Hasty Treat - TypeScripts Strict Explain...

Wes Bos & Scott Tolinski - Full Stack Javascript Web Developers
About this episode

In this Hasty Treat, Scott and Wes talk about the Typescript strict flag — what it does and why you might use it.

Sanity - Sponsor

Sanity.io is a real-time headless CMS with a fully customizable Content Studio built in React. Get a Sanity powered site up and running in minutes at sanity.io/create. Get an awesome supercharged free developer plan on sanity.io/syntax.

LogRocket - Sponsor

LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

Show Notes

02:50 - What is it?

  • Future versions of TypeScript may introduce additional stricter checking under this flag, so upgrades of TypeScript might result in new type errors in your program. When appropriate and possible, a corresponding flag will be added to disable that behavior.

03:26 - noImplicitAny

  • The any type in TypeScript is exactly that - it can be anything.
  • TypeScript will try to infer the type. When it can’t it will be any.
  • Sometimes you need any, but if that is the case, you must explicitly type it as any.
  • If something is implicitly any - it might be a mistake, or you forgot to type it. Risky!

06:01 - noImplicitThis

  • You must type this - it can’t be implicitly inferred.

06:47 - strictFunctionTypes

  • If you have a type that is a function and it doesn’t 100%.

07:44 - alwaysStrict

  • Always turns on strict mode. You can’t do things like redeclare var variables.

09:25 - strictNullChecks

  • Makes you check that the item is actually there before accessing a value or method from it.
  • Imagine you filter or find on an array, or query selector a DOM element. There is a possibility that nothing is there. strictNullChecks makes you check that it’s there - like an if statement.
  • Optional chaining is super handy here.

11:18 - strictBindCallApply

12:38 - strictPropertyInitialization

13:37 - useUnknownInCatchVariables

Links

Tweet us your tasty treats!

Up next
Today
945: Chrome Dev Tools MCP Server
Scott and Wes dive into Chrome’s new MCP server; a dev tools API powered by Puppeteer that gives your scripts, editors, and AI agents full access to Chrome. They break down how it works, what it can (and can’t) do, and how it might change debugging and automation for developers S ... Show More
29m 14s
Oct 8
944: Is Coinbase Really Writing Half Their Code With AI?
Wes and Scott talk with Kyle Cesmat about how Coinbase is writing nearly half its code with AI—while keeping quality and security front and center. They dig into tools like Cursor and Claude Code, agent-driven workflows, code review challenges, and how AI is reshaping developer p ... Show More
49m 6s
Oct 6
943: Modern React with Ricky Hanlon (React Core Dev)
Scott and Wes sit down with Ricky Hanlon from the React core team at Facebook to dive into the latest features and APIs shaping modern React development. From transitions and Suspense to fetching strategies and future directions, this episode breaks down what’s next for React and ... Show More
38m 36s
Recommended Episodes
Jun 2022
ESLint and TypeScript
Josh Goldberg joins Nick, Chris & a very nasally-sounding KBall for a fun conversation around TypeScript ESLint. They discuss why we need ESLint when we have TypeScript, some useful rules in typescript-eslint, how it works, and a few hot takes along the way! Discuss on Changelog ... Show More
1h 3m
May 2023
The ORMazing show
Nick & KBall sit down with the brilliant Stephen Haberman to discuss all things ORMs! 💻🔍 From the advantages and disadvantages of ORMs in general, to delving into the intricacies of his innovative project Joist, which brings a fresh, idiomatic, ActiveRecord-esque approach to Ty ... Show More
1h 12m
Jun 2020
Tue. 06/02 – Everything is Postponed
Facebook finally lets you clean out your old crap from your basement (I mean, past). AT&T won’t count HBO Max against your mobile data cap. Every tech event is postponed again. A whole bunch of OS update news, and a time capsule from another era.Sponsors:Tiny CapitalExpressVPN.co ... Show More
16m 13s
Mar 2023
Transcripciones: Español para Negocios 📝
¿Quieres comunicarte mejor en contextos de negocios? 👔 Adquiere las transcripciones del podcast Español para Negocios y no te pierdas ningún detalle de nuestros episodios. Disponibles en el siguiente enlace ⬇️ https://latinele.uteach.io/products/6 Si te gustan nuestros episodios ... Show More
56s
Feb 2024
711 - Business Phrases
I’m sure you have a lot on your plate, so thanks a lot for checking out my podcast. Today I have something special for everyone working in an international environment. I’m not saying that I have the silver bullet, but I think this episode is going to be a game changer for you. F ... Show More
9m 39s
Feb 2024
E167: Nvidia smashes earnings (again), Google's Woke AI disaster, Groq's LPU breakthrough & more
(0:00) Bestie intros: Banana boat! (2:34) Nvidia smashes expectations again: understanding its terminal value and bull/bear cases in the context of the history of the internet (27:26) Groq's big week, training vs. inference, LPUs vs. GPUs, how to succeed in deep tech (49:37) Goog ... Show More
1h 20m
Jul 2021
Becoming A Master of Microsoft Word
Guest Marie Stockton is an estate planning lawyer laser-focused on making sure her clients understand what they’re signing. She’s mastering document prep tools to assure they have the look and feel that encourages reading and comprehension. Topics: Making the shift from WordPerfe ... Show More
33m 2s
Feb 2024
Dr. Becky Kennedy: Protocols for Excellent Parenting & Improving Relationships of All Kinds
In this episode, my guest is Dr. Becky Kennedy, Ph.D., a clinical psychologist, bestselling author, and founder of Good Inside, an education platform for parents and parents-to-be. We discuss actionable protocols for raising resilient, emotionally healthy kids and effective alter ... Show More
2h 49m
Feb 2024
709 - 9 Ways To Use Have
For this English lesson, We’re going to look at nine different ways that we use the verb have. Have is one of those interesting words in English that has multiple meanings and uses, as well as a number of different grammar patterns. By the way, have is an irregular verb, and the ... Show More
7m 41s