Intro to TypeScript

Embarc Collective

Zabi Babar, Frontend Software Engineer

GreenLight IoT

Topics

  • What is TypeScript?
  • Why use TypeScript?
  • Primitives
  • Arrays and Tuples
  • Functions
  • Objects (Type Aliases and Interfaces)
  • Classes
  • Literal Types & Union Types

Who has experience with TypeScript?

What is TypeScript?

  • TypeScript is an open-source language developed and maintained by Microsoft.
  • First appeared in October 2012 after two years on internal development at Microsoft.
  • It is a typed superset of JavaScript that compiles into JavaScript.
  • It works on the frontend and backend.
  • It is multi-paradigm; supports OOP and functional 

Why use TypeScript?

  • Types + JavaScript = TypeScript
  • Strongly and statically typed
  • Gives developer confidence in their own code
  • Makes it easy to find bugs in editor and during compile-time

What is the type of message?

One of the Most Loved

One of the Most Wanted

Primitives

  • string (no other char types)
  • number (no int or float)
  • boolean
  • undefined
  • null
  • void

Arrays & Tuples

Functions

Objects

Classes

More Types

React Demo

Questions?

Intro to TypeScript

Embarc Collective

Zabi Babar, Frontend Software Engineer

GreenLight IoT

Intro to TypeScript

By Zabi Babar

Intro to TypeScript

  • 339