Category: TypeScript

TypeScript is used for creating large scale JavaScript applications.

Declaring variables in TypeScript

TypeScript is a strongly type language.This means that variables and expressions are type checked at compile time.But if required we can turn off this behavior. Variable declaration in JavaScript In JavaScript variables are not strongly typed.This means that following statements...

Decorators in TypeScript

Decorators are a powerful feature in TypeScript. Decorators in TypeScript allows us to use declarative programming. When we use declarative we don’t need to specify all the steps to achieve a task.In declarative programming we just specify what we require without...

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...