let x: number = 6;
You should instead allow the compiler to infer where it can and do
let x = 6;
Inference doesn't work across function calls like it does (did?) in Flow, which is a good thing, so those always need to be typed.
If you wanted the type of x to be 6 instead of number, you would use
let x = 6 as const;
let x: number = 6;
You should instead allow the compiler to infer where it can and do
let x = 6;
Inference doesn't work across function calls like it does (did?) in Flow, which is a good thing, so those always need to be typed.
If you wanted the type of x to be 6 instead of number, you would use
let x = 6 as const;