TypeScript-de ýerleri üýtgetmek

Bizde käbir setir üýtgeýjisi bolsun:

typescriptlet test: string = 'abc';

Ona başga bir setir ýerini ýazalyň:

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

Indi bolsa oňa san ýazmaga synanyşalyň. Bu ýagdaýda TypeScript ýalňyşlyk bildirer, sebäbi biz üýtgeýjiniň tipini üýtgetmäge synanyşýarys:

typescriptlet test: string = 'abc';
test = 123; // ýalňyşlyk bildirer
Задание 1

Kody işletmezden öň, onuň işlenişiniň netijesi nähili bolar?

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

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

Kody işletmezden öň, onuň işlenişiniň netijesi nähili bolar?

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

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

Kody işletmezden öň, onuň işlenişiniň netijesi nähili bolar?

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

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

Kody işletmezden öň, onuň işlenişiniň netijesi nähili bolar?

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

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

Kody işletmezden öň, onuň işlenişiniň netijesi nähili bolar?

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

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

Kody işletmezden öň, onuň işlenişiniň netijesi nähili bolar?

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

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

Kody işletmezden öň, onuň işlenişiniň netijesi nähili bolar?

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

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

Kody işletmezden öň, onuň işlenişiniň netijesi nähili bolar?

typescriptlet test: number = 123;
test = 456;

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

Kody işletmezden öň, onuň işlenişiniň netijesi nähili bolar?

typescriptlet test: boolean = true;
test = false;

console.log(test);