An Introduction to TypeScript

An Introduction to TypeScript

An Introduction to TypeScript. A basic overview on TypeScript interfaces, types and enums. To understand TypeScript, we first need to understand what kind of problems JavaScript introduces. Intro to TypeScript was a thing, brief overview of TypeScript, focusing on its type system.

A basic overview on TypeScript interfaces, types and enums.

To understand TypeScript, we first need to understand what kind of problems JavaScript introduces.

Before TypeScript was a thing, JavaScript had no concept of type checking. It is a dynamically typed language. At one end you can declare a variable and have it store a string. On another end you can have it store a number. Let’s take a look at the following example:

let someVar = 'hello';
someVar = 3;

While that is fine if you are writing a simple application, this can have its own implications. Let’s take a look at the following scenario:

//Note this is not a real api; the example above is used to explain a flaw javascript has
let obj = {};
fetch('https://randomapi').then(res => res.json()).then(data => {
  //let's say data have two fields called name and id, then obj will have name and id as attributes
  obj = data;
});

obj = 3;
//this will print out an undefined error
console.log("print obj name: ", obj.name

web-development typescript software-development javascript programming

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Offshore Software Development - Best Practices

To make the most out of the benefits of offshore software development, you should understand the crucial factors that affect offshore development.

Hire Dedicated JavaScript Developers -Hire JavaScript Developers

Hire dedicated JavaScript Developers who are proficient in AngularJS, ReactJS, NodeJS, & VueJS frameworks. Get flexible hiring models as per your business requirements.

TypeScript Tutorial For JavaScript Developers - TypeScript Basics

TypeScript Tutorial For JavaScript Developers - TypeScript Basics. I will show you guys 4 example of JavaScript code, and how to convert it to TypeScript. This is a typescript beginners tutorial.

JS Development Company India | JavaScript Development Services

Best JavaScript web app development company in India, PixelCrayons provides full stack JS development & maintenance. 16+ Yrs Exp., 60% less cost, Strict NDA

Software Developer vs Web Developer | Difference Web Developer & Software Developer

Software Developer vs Web Developer | Difference Web Developer & Software Developer | Software development and web development are normally used interchangeably. Although both include development, a software developer has different responsibilities from that of a web developer.