TypeScript Fundamentals

Adding strong typing to large JavaScript apps with TypeScript helps reduce bugs, and keep developers on the performant and maintainable path. We'll look at recent advancements in the JavaScript standard like classes and decorators; some new tools for managing asynchrony; and then dive into TypeScript to add static typing to the mix. In this course, you'll learn everything you need to know to be set up for success when using TypeScript to build a modern web app.

TypeScript Fundamentals

Beyond JavaScript

We are essentially using "modern JavaScript with types", and we will start adding in other language features that TypeScript brings to the table.

  • Beyond JavaScriptAccess Modifiers

    The public, private and protected access modifiers allow us to control what our classes expose down their inheritance chain, and out to the rest of the world. We'll study how structural type matching is affected by these modifiers, and provide some guidance and best practices to strike the appropriate balance between safety and flexibility.

  • Beyond JavaScriptReadonly and Static

    The readonly and static keywords further enhance what we can do with JavaScript classes.

  • Beyond JavaScriptEXERCISE: Access modifiers

    Solve the provided exercise, such that all tests pass, and the TypeScript compiler emits no warnings or errors

  • Beyond JavaScriptEnums

    Enums allow us to group a collection of related values together. TypeScript provides us with a robust and full-featured solution in this area, with some options that let us strike the balance between full-featured and lightweight.

  • Beyond JavaScriptMixins, Abstract Classes and Interfaces

    When it comes to inheritance, we have many options to choose from. We'll look at the appropriateness of abstract classes, interfaces, and mixins for various use cases, highlighting the pros and cons of each.

  • Beyond JavaScriptEXERCISE: Data Modeling

    Solve the provided exercise, such that all tests pass, and the TypeScript compiler emits no warnings or errors

  • Beyond JavaScriptCode Style

    Odds are, you're probably used to writing plain JavaScript. We'll go over some code style best practices that you may want to add to your tslint typescript linting configuration.

  • Beyond JavaScriptUsing TypeScript with React

    React components provide us with some excellent opportunities to reap the benefits of what we've learned so far. We'll review React's DefinitelyTyped library type descriptions and see how much our editor helps us, compared to what we'd see were we using "vanilla JavaScript".

  • Beyond JavaScriptEXERCISE: A typed react component

    Rebuild the UI component for our color picker, using interfaces for the component state and props.