Data Types in TypeScript
In TypeScript, when declaring a variable, we must specify its type. To do this, we must write a colon after the variable name, and then specify the desired type.
For example, let's make a string variable:
let test: string = 'abc';
And now the numerical one:
let test: number = 123;
And now the logical one:
let test: boolean = true;
It is not necessary to assign a value to a variable immediately when declaring it. You can first declare the variable, and then assign a value to it later in the code. Example:
let test: string;
test = 'abc';
Make three variables: one string, one number, and one boolean.