## What is TypeScript
TypeScript is a:
1. programming language
2. type checker
3. compiler/transpiler
4. language service
### Type Inference
TypeScript uses *type inference*, which means that everywhere in our program, TypeScript expects the data type of the variable to match the type of the value initially assigned to it at declaration.
TypeScript recognizes JavaScript’s built-in “primitive” data types:
- boolean
- number
- null
- string
- undefined
TypeScript will surface an error if the variable is assigned to a value of a different type.
### `Any`
There are some places where TypeScript will not try to infer what type something is—generally when a variable is declared without being assigned an initial value.
```ts
let onOrOff;
onOrOff = 1;
onOrOff = false;
```
In the code above, `onOrOff` is declared without an initial value. TypeScript considers it to be of type `any`, and, therefore, doesn’t produce an error when the variable’s assignment is changed from a `number` value to a `boolean` value.