export {};
let bool = true;
const arr = [1, 2, 3];
const tuple = [true, 1];
bool = 1; // error!
let v1 = 123;
let v2 = 'abc';
v1 = 'a'; // error
v2 = 456; // error
this is because of type inference
export {};
const v1 = 123;
const v2 = "abc";
let v3: typeof v1 = 234; // const v1 : 123;
if you typeof , declared more strictly
of course you have to write the type if you want, but type inference is possible.