What is TypeScript?

Maximilian Schwarzmüller
A free video tutorial from Maximilian Schwarzmüller
Professional Web Developer and Instructor
4.6 instructor rating • 35 courses • 1,238,669 students

Lecture description

Angular uses TypeScript. What does that mean for you?

Learn more from the full course

Angular - The Complete Guide (2020 Edition)

Master Angular 10 (formerly "Angular 2") and build awesome, reactive web apps with the successor of Angular.js

33:20:33 of on-demand video • Updated November 2020

  • Develop modern, complex, responsive and scalable web applications with Angular 11
  • Fully understand the architecture behind an Angular application and how to use it
  • Use the gained, deep understanding of the Angular fundamentals to quickly establish yourself as a frontend developer
  • Create single-page applications with one of the most modern JavaScript frameworks out there
English We're about to get started soon, but I did mention that we're going to use Typescript in this course. We already did use it when we changed the first app. What is Typescript? Typescript, really is just a superset of JavaScript. It offers more features than vanilla JavaScript, like classes, interfaces and, very important, which gives it the name, types; strong typing. So, you define in Typescript if a certain variable is a number, a string or something else. You don't do this in vanilla JavaScript. There, you have dynamic typing. You can have a string variable and then you can assign a number and that's totally fine. That won't work in Typescript. It will give you an error and therefore it allows you to write much more robust code which gets checked at the time you write it; and not just at the time you run it. This is a great enhancement. However, Typescript doesn't run in the browser, so it is compiled to JavaScript in the end. This compilation is handled by the CLI; one of the reasons why we need the CLI, why we need a project management tool like the CLI. Now, this compilation is really fast and therefore, in the end, in the browser JavaScript is going to run. We're not writing the Angular app in JavaScript though because, whilst technically possible, that wouldn't be much fun. A lot of the features really only exist in Typescript and Angular is meant to be used together with Typescript. That being said, you don't have to learn Typescript for this course. You should be able to pick it up along the way. I do have a whole section giving a brief introduction into Typescript at the end of this course, so feel free to jump ahead. Go through that section right now if you feel like you need it or, throughout the course if you feel like you need some deeper dive into some of the features you see there and you should be fine, you should be able to follow along just fine. Of course, if you feel like it, feel free to pick up another course or tutorial focused on Typescript so that you have something to look at if something is unclear in this course. Generally though, Typescript is an addition to JavaScript; not a complete replacement, so a lot of the commands will look really familiar.