TypeScript. Types

Home » Tutorials » JavaScript » TypeScript. Types
TypeScript is the superset of JavaScript with strict types. TypeScript realize the most modern ECMAScript features.
In this video we’ll consider types in TypeScript, including enum, any and tuples.
Code lesson
let flag: boolean = true;
flag = false;

let product: [number, string];
product = [1, 'iphone'];
// product = ['Камиль', 1]; error

enum currencies {DOLLAR, EURO, ROUBLE};

enum languages {JavaScript = 11, PHP, Java};

let fullName: any = 'Kamil Abzalov';
fullName = 5;

let a: string | number;

type version = string | number;

let ver: version = 10.1;



Submit a Comment

Your email address will not be published. Required fields are marked *

Подписаться на рассылку

Будьте в курсе - получайте последние статьи на свой email

Ваша подписка успешно оформлена

Pin It on Pinterest

Share This