Thursday, July 14, 2016

TypeScript 2.0: end of null problems

TypeScript 2.0 Beta Brings Option Types, Discriminated Unions, and More

"Non-nullable types aim to solve the most common source of bugs in JavaScript, says Rosenwasser: null and undefined. Non-nullable types forbid assigning null to a variable, unless it is declared as an option type:"
let foo1: string = null; // Error!
let foo2: string | null = null; // Option type

Markdown Tutorials

Toward a Better Markdown Tutorial @ CODING HORROR