Typescript Stephen Grider |verified| -

When you use if (isAddAction(action)) , TypeScript narrows the type inside the block. Grider calls this "teaching the compiler your business logic."

After his course, you will open a tsconfig.json and see not a wall of noise, but a safety checklist. You will write functions where the type signature tells a story: "Given this, I guarantee that." You will refactor a 500-line JavaScript file into a 200-line TypeScript file, removing entire categories of bugs. typescript stephen grider

You will type fetch(URL).then(res => res.json()) a dozen times. Each time, he stops you. "Does TypeScript know that res.json() returns a WeatherReport ? No. It thinks it's any . You just lost all your safety." When you use if (isAddAction(action)) , TypeScript narrows