Understanding Nullable Types in Typescript with examples

Understanding Nullable Types in Typescript with examples: Nullable type is introduced in typescript 2.0, this helps us to keep initialized objects to have some values other than null all the time.   Default number | Assigning null: For eg: let home2OfficeKm = 10; home2OfficeKm = null;     Works fine in typescript 2.0 earlier versions, if you do not want […]

364 total views, 3 views today

» Read more

Difference between Javascript and Typescript

Difference between Javascript and Typescript: Javascript Typescript var myVar = ‘hello’; myVar = 10; console.log(myVar); // prints 10 let myVar = ‘hello’; myVar = 10; console.log(myVar) // we get the error here stating //Type ‘number’ is not assignable to type ‘string’ We dont have a type number only in javascript. Typescript does not have float/double types, everything is considered as […]

534 total views, 3 views today

» Read more

Typescript Hello world in local system Example

Step 1: Install Typescript in Your Local Machine Install typescript in your local machine to compile and test typescript. Instructions / steps to install typescript can be found in the below link We need typescript in local,because typescript is not like javascript which can directly run on the browser. It has to be converted to javascript before running in any […]

343 total views, 2 views today

» Read more

How to install typescript in windows 10?

How to install typescript in windows 10? Ensure you have already node package manager(npm) installed on your machine if this is not installed then follow the below link to get it installed, How to install node js in windows 10 ?   We should definitely have npm package manager installed on our machine, once you installed npm you can verify […]

362 total views, 4 views today

» Read more

Typescript Quick Notes for Angular Developers

Typescript Quick Notes for Angular Developers: As because of angular’s reach angular developers are forced to learn typescript. It is not tough but it is better to know the below basic syntax to code faster.   1. Converting array to JSON in typescript   selectedItems = []; JSON.stringify(this.selectedItems);       2. For loop in typescript   for(let item of […]

545 total views, no views today

» Read more