Changing Values ​​in TypeScript

Let's say we have some string variable:

typescriptlet test: string = 'abc';

Let's write another string value into it:

typescriptlet test: string = 'abc';
test = 'def';

Now let's try to write a number into it. In this case, TypeScript will throw an error, since we are trying to change the type of the variable:

typescriptlet test: string = 'abc';
test = 123; // will give an error
Задание 1

Without running the code, determine what the result of executing the code will be:

typescriptlet test: number = 123;
test = 'abc';

console.log(test);
Задание 2

Without running the code, determine what the result of executing the code will be:

typescriptlet test: string = 'abc';
test = 123;

console.log(test);
Задание 3

Without running the code, determine what the result of executing the code will be:

typescriptlet test: string = 'abc';
test = '123';

console.log(test);
Задание 4

Without running the code, determine what the result of executing the code will be:

typescriptlet test: string = 'abc';
test = true;

console.log(test);
Задание 5

Without running the code, determine what the result of executing the code will be:

typescriptlet test: string = 123;
test = 'abc';

console.log(test);
Задание 6

Without running the code, determine what the result of executing the code will be:

typescriptlet test: string = '123';
test = '456';

console.log(test);
Задание 7

Without running the code, determine what the result of executing the code will be:

typescriptlet test: number = '123';
test = '456';

console.log(test);
Задание 8

Without running the code, determine what the result of executing the code will be:

typescriptlet test: number = 123;
test = 456;

console.log(test);
Задание 9

Without running the code, determine what the result of executing the code will be:

typescriptlet test: boolean = true;
test = false;

console.log(test);