In JavaScript, when an undeclared variable is used, it is automatically declared in global scope, often causing hard-to-find bugs.
For this reason, in TypeScript, variables can be used just after they have been declared:
When a variable is initialized, its type may be automatically inferred, so it may be omitted:
However, when a variable is not initialized, the specification of the variable type is not obligatory! The type assigned to a not initialized variable when the type is not specified ...