3 ms·
Some of these missing checks were why Flow was an attractive choice when weighing [Flow vs Typescript][1]. For example, it wasn't until Typescript 2.0 that we
by romellem 7mo ago
Some of these missing checks were why Flow was an attractive choice when weighing [Flow vs Typescript][1].
For example, it wasn't until Typescript 2.0 that we got null checks!
- https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#null--and-undefined-aware-types https://www.typescriptlang.org/docs/handbook/release-notes/t...
function getLength(s: string): number {
return s.length; // Runtime crash if s is null/undefined
}
getLength(null); // TypeScript <2.0 would not error here
[1]: https://djcordhose.github.io/flow-vs-typescript/2016_hhjs.html#/15 https://djcordhose.github.io/flow-vs-typescript/2016_hhjs.ht...