TypeScript ExpressLearn TypeScript through interactive examples

    TypeScript

    Welcome to TypeScript Express! TypeScript is a versatile language for building websites, servers, mobile apps, more. In this guide we'll cover TypeScript from the ground up.

    About this guide

    This guide is intended for developers who know at least one other programming language well. We won't cover general programming concepts (e.g. what is a variable?), but rather TypeScript-specific concepts (e.g. how do variables work in TypeScript?). Since TypeScript is an extension of JavaScript, we'll be covering both together in this guide. If you'd prefer to learn non-typed JavaScript, instead head to the JavaScript-only flavor of this site, JavaScript Express.

    I hope you enjoy learning TypeScript. Most of this guide was written by me, @dvnabbott. Some pages may be written by other authors (listed at top of each page).

    TypeScript sandbox

    This guide uses a web-based JavaScript sandbox, which can evaluate TypeScript code samples and display console logs inline with the code. For example:

    JavaScript is quirky

    The first version of JavaScript was famously written in 10 days by Brendan Eich while working on Mozilla. It's full of quirky features that were meant to be convenient for writing small scripts, but which can be counterintuitive when building large apps.

    Unlike most other languages, JavaScript is almost completely backwards compatible. New syntax and standard library methods are added often, but almost nothing is ever removed, since that would break too many existing websites.

    Since JavaScript has quirky features and since they likely won't be removed, it's important to understand the common patterns and idioms used by JavaScript developers in order to write high-quality software.

    TypeScript

    JavaScript is dynamically typed, which means that type checking happens at runtime. This is convenient for small scripts, but for large apps it's often helpful to have type checking at compile-time.

    TypeScript is a language that extends JavaScript, adding syntax for type declarations and annotations. The TypeScript compiler can then perform compile-time type checking, before transforming the TypeScript code into JavaScript.

    Alright, let's dive in!

    Next - Types