Skip to content

AliNazar1991/Advanced.Typescript.code.samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced Typescript code samples

Code samples of advanced Typescript features

  • numeric separator

How to

To run each example in the folders, open a terminal and cd into the specific folder and enter "npm start".

Make sure you have installed @types/node using the following command in project root: npm install @types/node --save-dev

Dependencies used

  • ts-node for both compiling and running the typescript files, without having to deal with the compiled js files.

Definitions

Type annotations : code we add to tell Typescript what type of value a variable will refer to, that is, we developers tell typescript the type of a variable or object etc. Ex: const apples: number = 5; In above code statement, ": number" is called the type annotation. Type annotations works with all object types (functions, arrays, classes, objects) and primitive types, string, number, symbol, null etc

Type inference : Typescript tries to figure out what type of value a variable refers to, that is, typescript tries to guess the type of an object, variable etc.

About

Code samples with advanced Typescript features

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published