In JavaScript, variables can hold values of many different types.
TypeScript lets us describe exactly what kind of values a variable can hold.
You can give a variable an explicit type with :number, or you can let TypeScript infer the type automatically from its initial value.
Example:
let score: number; // explicit number type annotation
let score = 100; // inferred number type
Give the variable greeting the type of string.
:string."Hello World".Now declare another variable firstName without a type annotation.
firstName in the editor to see how TypeScript inferred the type string.