/TypeScript-Training

Simple repository for training on TypeScript

Primary LanguageTypeScriptMIT LicenseMIT

TypeScript-Training

Simple repository for training on TypeScript

Introduction

  • started by the folks at Microsoft, as a way to make JavaScript scale easily for large applications.
  • Some Caveats of Typescript:
  1. Its a superset of JavaScript, with the introduction of types

  2. It compiles back into JavaScript which your browser can understand

  3. Given that it compiles back into plain JavaScript, you need a compiler

Installation

  • through NPM:
npm install -g typescript

Compiling

How can you compile typescript? There are multiple ways:

  1. Use terminal and the TypeScript Compiler
  • tsc stands for TypeScript compiler
  • Syntax:
tsc fileName.ts
tsc folderName

This will compile the typescript file or all TS files in that folder into JavaScript files, with the same name

  1. You can also install the compiler into your favorite IDE and build from there

  2. For actual projects, this will be included in your build system or build tool - so that you will have browser ready JavaScript for your project

Setting up your IDE for typescript use