The any type in TypeScript
Sometimes we may need to declare the type of variables that may not be known to us at the time we write the application.
For this, the any type is used, which allows values to be checked at compile time. Let's look at an example. Let's assign a value of type any to a variable:
typescriptlet test: any;
Let's write a number into this variable:
typescripttest = 123;
Now let's write the following string into this variable:
typescripttest = 'abc';
Задание 1
Without running the code, determine what the result of executing the code will be:
typescriptlet test1: number = 123;
let test2: string = 'abc';
let test3: any;
test3 = test1;
console.log(test3);
test3 = test2;
console.log(test3);