Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
TypeScript for Professionals - by Basarat
Rating: 4.6 out of 5(4,658 ratings)
20,109 students

TypeScript for Professionals - by Basarat

Learn all about the TypeScript type system - taught by a Microsoft MVP
Last updated 1/2024
English

What you'll learn

  • Use TypeScript at your day to day job
  • Learn the Basics of TypeScript's Type System
  • Use Types for annotating any JavaScript Object
  • Learn Advanced TypeScript concepts
  • Create Complex Type Utility Functions

Course content

5 sections75 lectures3h 38m total length
  • Setup and Hello World5:44

    Install NodeJS and TypeScript, set up tsconfig with src and lib folders, and write index.ts. Compile with tsc watch, run node lib/index.js, and observe type annotations removed in JavaScript.

  • Primitive Types1:42
  • Instance Types1:52

    Explore how JavaScript classes and built-in types like array and set are annotated in TypeScript, and how generics apply to instance types such as queues and user-defined classes.

  • Arrays And Tuples1:38

    Explore TypeScript’s array shorthand by declaring element types with square brackets, enforce uniform types across arrays, and use tuples for fixed-length two-number points with compile-time checks.

  • Object Types and Type Aliases1:33

    Use type aliases to name the intent and represent a point in space, reducing duplication by reusing a common object shape with X and Y numbers.

  • const declarations1:03

    Discover how const declarations in TypeScript prevent reassignment, catch initialization mistakes at compile time with type annotations for a point with X and Y, and still allow property mutations.

  • Functions1:57

    Annotate function parameters and return types in TypeScript, using void for no return value and rest parameters for multiple arguments, and explore shorthand function type syntax and type aliases.

  • Structural Typing2:10

    Learn how TypeScript structural typing determines type compatibility by structure, not names, using examples of user, product, and 2D versus 3D points, including duck typing and compile-time checks.

  • Classes1:48

    Explore TypeScript classes, including constructors, properties, and methods like move, with public, private, and protected access modifiers, and extend a Bird class with a fly method.

  • Target Compiler Option2:37

    Explore how the TypeScript compiler target option in tsconfig.json shapes emitted JavaScript, switching between ES5 compatibility and ES2015/ES6 class support, including private fields and WeakMap usage.

  • Generics3:02

    Explore generics in TypeScript by using a queue with a type parameter T to enforce that push and pop operations handle only items of the same type, preventing runtime errors.

  • Special Types : any and unknown2:00

    Explore the any and unknown types in TypeScript, compare their behavior and safety, and learn when to bypass type checks versus when to enforce checks.

  • JavaScript to TypeScript1:32

    Learn how to migrate JavaScript to TypeScript by using any for quick fixes or unknown for safer refactoring, and apply runtime checks with typeof to guard values.

  • Creating a Frontend Project3:49

    Boot a type-safe frontend react app with TypeScript using Create React App, configure tsconfig, and run a live development server with hot reload, build production assets, and serve static files.

  • Type Assertions2:15

    Use the as keyword type assertions in TypeScript (not the angle bracket form for TSX) to tell compiler the value’s type when a function returns unknown, enabling string method calls.

  • Type Casting1:16

    Discover the distinction between type casting and type assertions in TypeScript, and learn to coerce a string to a number using JavaScript tricks like the plus operator, illustrating runtime coercion.

  • Modules1:55

    Export a palindrome utility from a file using the export keyword, then import it in another file via a relative path. TypeScript supports the full module syntax, including namespace imports.

  • Type Declarations4:25

    Learn how TypeScript uses declaration files to add Node.js runtime typings, declare process, install @types/node, and enable type safety for fs and express in Node.js projects.

  • Creating an NPM Package3:20

    Initialize a TypeScript npm package, install TypeScript as a dependency, generate tsconfig with src and lib, enable source maps, declarations, and declaration map, then build and publish for IntelliSense use.

  • Async Await3:05

    Learn to replace chained setTimeout calls with an async function and a delay promise that resolves after time, awaiting logs; TypeScript transpiles this to es5 for older browsers.

  • ts-node1:40

    Learn to run TypeScript by compiling with npx tsc to JavaScript in a lib folder, then execute with node; use ts-node for on-the-fly execution and npm scripts like npm start.

Requirements

  • Beginner JavaScript knowledge

Description

I've been teaching TypeScript since 2012 (since launch). While teaching Juniors as well as Experts, I gathered a few tricks to make it an easy and smooth learning experience. I share those experiences with you. The objective is simple:


  • You can feel confident about what TypeScript is and offers

  • You become a competent TypeScript / JavaScript developer

A lot of effort has gone into this course to make sure you get all the knowledge you need, as quickly as possible.

Why TypeScript

I've been teaching and working with JavaScript for the past 10 years. TypeScript is hands down the best way to learn JavaScript. Give a beginner JavaScript developer a workflow with the TypeScript compiler and they can actually learn stuff themselves thanks to TypeScript's excellent 1000+ compiler errors that prevent common mistakes.

Why this course

I'm a Microsoft MVP (Most Valuable Professional) for TypeScript thanks to my teaching contributions in the form of books, various videos and answers on StackOverflow.

This provides the best guidance possible for all the ways you can use TypeScript for your JavaScript projects to give you the most chances of success in your professional career. This course is based on my experience in that area and curated based on key workshop insights.

Who this course is for:

  • Programmers looking to master TypeScript