Tag: TypeScript
-
Union and Intersection of types in TypeScript
Do you know, TypeScript allows union and Intersection of types? Why you need that? Let us assume you need to create a function that checks whether the passed value is boolean true and returns true, otherwise returns null. That function may look like below, function trueOrNull(foo: any): any { if (foo === true) { return true; } return undefined; } console.log(trueOrNull(88)); // null As you see, the…
-
Video – Step by Step using TypeScript in a Node.js Application
This video explains steps to use TypeScript in a Node.js application. You can read step by step article on the same here – here Download source code from here To start with create a folder and run npm init command inside the folder. After that install these dependencies, npm install -D typescript npm install -D…
-
Step by Step using TypeScript in a Node.js Application
Download or clone source code from here In this blog post, you are going to learn to configure the Node.js application to use TypeScript. At the end of the blog post, you will have a REST API created using TypeScript and Express in Node.js. Before starting to make sure that you have NodeJS installed on…
-
Getting started with TypeScript
TypeScript is superset of JavaScript created by Microsoft. TypeScript – according to its website – “lets you write JavaScript the way you really want to. TypeScript is a typed superset of JavaScript that compiles to plain JavaScript”. Some features of TypeScript include: Support standard JavaScript Static typing Encapsulation using the classes and the modules Constructors,…