Typescript vs Flow. Which static type checker should you use on your project?

Carolina Ramirez
Geek Culture
Published in
6 min readDec 10, 2021

--

Recently I started working on a new JavaScript project, while going through the code I found type checking on JavaScript files, it threw me off… JavaScript doesn’t have built-in type checking functionalities.. How is this project not throwing errors?… a lot of questions came to my mind, so I needed to research a bit further… and there it was, a comment on the top of the file, this project was using a different kind of type checker that I didn’t know, it was Flow.

So once the mystery was solved some new questions came up, Why are they using Flow? Wouldn’t it be better to use Typescript? Is it really one better than the other? So I had to do some research, and in this article I will show you my findings regarding this issue.

Static Type Checkers

Before going deep into Flow and Typescript, let’s begin by understanding what is a static type checker for JavaScript and why is it important.

JavaScript data types are dynamic, this means that the value we assign to a variable determines the type of that variable, and the variable data type changes as soon as we assign a value of a different type to it. For example:

let x = 346  // Here x is a numberx = 'something' // Now x is a…

--

--

Carolina Ramirez
Geek Culture

Frontend Developer | Tech writer and enthusiast | Always learning, always improving