Dive into Flow
17
$ flow check
src/add.js:7
7: const three = add('1', 2);
^^^^^^^^^^^ function call
7: const three = add('1', 2);
^^^ string. This type is incompatible with
3: function add(a: number, b: number): number {
^^^^^^ number
function add(a: number, b: number): number {
return a + b;
}
// ’12’ : string
const three: number = add(‘1’, 2);