I stumbled upon a cool project which might be of interest to all of you Flow fans. ❤

What is Flow?

Flow is a static type checker for Javascript.

Flow drastically reduces bugs and helps us navigate our code.

Javascript is a loosely typed language — by default, we don’t define types for our variables, function arguments, and so on. Flow is a great way to add static typing to our Javascript.

Here’s how a “loosely” typed add function might look. Loosely typed, meaning there is no type checking going on.

Here’s how we would write the add function with Flow included.

Noticed we added the // @flow comment at the top and added type checking for our function parameters. Essentially, we are telling Javascript the following: please make sure the arguments are numbers, and if they’re not, throw me a feedback error.

Great for avoiding bugs.