Static type checking with TypeScript and Flow

Static type checking is where you have a process that looks at how variables are being used, and then throws a wobbly if you do something weird. By this, I mean that it looks at the type of each variable and uses type annotations (bits of text defining what type a variable is when the variable itself is defined) to ensure that functions don't mutate a variable in an unexpected way. This is called static typing, and it is a feature built into many robust languages, such as C++ and Java. While JavaScript's dynamic typing (also shared by lots of other web languages, such as PHP and Ruby) is helpful in some ways and enables a certain style of programming, it can also be incredibly frustrating due to its ...

Get D3.js: Cutting-edge Data Visualization now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.