Category: TypeScript

TypeScript is used for creating large scale JavaScript applications.

Data Types in TypeScript

TypeScript adds new useful features to JavaScript. One such feature is type system in TypeScript. In JavaScript types are dynamic,this means that variable are not of any specific type.So a variable can be assigned values of different types during its...

Declaring Modules in TypeScript

TypeScript has the concept of modules.Here we will see how to declare modules in TypeScript. When working on any application it helps to keep the code organized.Keeping the code organized provides the following advantages: Code is easier to locate since...

Renaming file or directory in Git

A common scenario while working with configuration management tools such as git is to rename existing files and directories. If you just rename an existing file or directory then git will not be aware of this change.You need to inform...

Generic Function in TypeScript

Generic functions are defined by declaring a type parameter when declaring the function ,in angular brackets.The type parameter is the placeholder which is replaced by the actual type arguments when the program executes. So we define a generic method as:...

Optional and Default valued parameters in TypeScript

Named and Default valued parameters in TypeScript is a useful feature which can help us remove code redundancy when we use method overloads. Optional Parameters in TypeScript When we define a function in TypeScript we provide list of parameters along...

Variable declaration in TypeScript

Variable declaration is important part of any programming language.Variable declaration in TypeScript is more important since it provides some improvements over JavaScript when declaring variable. TypeScript provides different ways of declaring variables.We can declare a variable using these ways depending...

Interface in Typescript

Interface means how one entity interacts with other.For example a class may have some internal implementation.But its only the interface which is visible to the consumers of the class. Unlike other types such as classes which provide the actual implementation in application...

Class in TypeScript

TypeScript provides man useful features which supports maintenance and better code management.One such feature which is available in object oriented languages such as c# is the concept of classes.We can declare classes in TypeScript. Following a simple class in TypeScript...

Getting started with TypeScript

TypeScript is a strongly typed programming language.It is superset of javascript.This means that it provides additional features not available in javascript.This includes features such as strong typing and type annotations. To create TypeScript applications we can either use the Visual...

Arrays in TypeScript

Array Declaration Arrays in TypeScript are declared like normal variables.But they use the square brackets [] to mark the variable as an array.

We declare number like a normal variable of datatype number.But after the datatype number we put...