Loading topic
string | number, and type annotations on variables and functions. You should also know that JavaScript has the values null and undefined, even if you have never thought hard about the differenc6 min readnull and undefined in JavaScript, and that you can edit a tsconfig.json. By the end you will know what the strictNullChecks option does to the type system, how to read the errors it produces, and wh6 min readnull and undefined, and how to turn on strictNullChecks in tsconfig.json. The earlier chapters covered those. Here you will learn how to write the types that describe "6 min readstrict (and so strictNullChecks) is on in your tsconfig.json, as set up earlier in this tutorial. The chapter covers how ? works on properties, parameters, and methods. It also covers how optio5 min readtsconfig.json, and have strictNullChecks enabled (usually through "strict": true). With that flag on, a value typed string | null cannot be used as a string until you show the compiler that it is not null. That showing is called narro5 min readnull and undefined differ, that strictNullChecks is on, and how to write nullable union types. It also assumes you can narrow a value with if. Earlier chapters covered all of these.5 min readstrictNullChecks makes null and undefined part of a type, and how optional chaining (?.) works. It covers the nullish coalescing operator ??, how it differs from ||, and the mistakes that follow from mixing them up.6 min read===, !==, typeof, and instanceof, and that you can read union types such as string | null. It also assumes strictNullChecks is on in your tsconfig.json. Here you will learn how to package a check into a reusable function, how to remove `5 min readstring | null, you have strictNullChecks turned on, and you can narrow a value with an if check. Here you will learn what the postfix ! operator does, what it does not do, when it is justified, and what to use in its place.6 min readstring | undefined, and how to turn on strictNullChecks in tsconfig.json. You should also know that a property you never assign reads as undefined at runtime.6 min readstrictNullChecks makes null and undefined part of a type, and how to narrow a value with if checks, ?., and ??. Here you apply those tools to the places where missing values enter a program. The code you write usually doesn't produce them. T6 min readstrictNullChecks enabled and you are comfortable with unions, narrowing, ?., ??, and optional properties. It covers two compiler options that "strict": true does not turn on. Each closes a gap that strictNullChecks leaves open.5 min readstrictNullChecks in a codebase that was written without it. It assumes you know the earlier material: nullable union types, narrowing, ?., ??, the ! operator, and the basics of tsconfig.json. It also assumes you can run tsc from the command line.7 min read