Develop effective and captivating websites (affiliate link)

Learn TypeScript and Get Good at It

TypeScript is a programming language by Microsoft, which is known as the synthetical superset of JavaScript.

TypeScript is a programming language by Microsoft, which is known as the synthetical superset of JavaScript. This means TypeScript is in fact the standard JavaScript equipped with additional language features – such as static typing.

If you’re wondering what static typing is all about please read our guide on Data Types in programming languages.

A type system is a compiler feature to ensure we’re not performing irrelevant operations on certain data objects – imagine dividing a text by another text! This doesn’t make sense right? Strongly typed languages ensure these sort of mistakes, which are unintentional most of the time, won’t happen.

And any time we make such mistakes, the type system alerts us before that faulty code finds its way to production.

Since JavaScript isn’t a strongly typed language in nature, it normally doesn’t care what you do with your data.

Although JavaScript doesn’t complain whenever you make a data-type-related mistake, it doesn’t mean your code won’t output unexpected results in production!

TypeScript ensure this won’t happen ?

In TypeScript code, you define a set of data types and contracts (a.k.a interfaces), then TypeScript makes sure you won’t violate these criteria; on the other hand, whatever you’ll do, you’ll know what you’re doing. There’s no room left for these types of mistakes.

That said, if a function is supposed to receive a number, you’ll have to pass it a number. Imagine you have a function, which takes a number and determines whether it’s odd or even. Now, if you pass it a string (say “James”), the TypeScript compiler would complain about it.

Please Note: JavaScript runtimes (browsers or Node.js) cannot run TypeScript code; This means, to run your code, you’ll have to transpile your TypeScript code to JavaScript code first.

Transpiling (or source-to-source compiling) means compiling the code of a high-level programming language to another high-level programming language; In this case, TypeScript to JavaScript. The transpilation process can be automated with Webpack.

If by now, you agree TypeScript is a must-learn technology, especially in large-scale JavaScript-based applications, you may use our cherry-picked learning materials below to get started right away.

In Case You're Wondering...

Many companies are now using TypeScript to build large-scale JavaScript-based applications, from small startups to tech giants such as Google, Microsoft, Facebook, Airbnb, Slack, etc

The short answer is: yes.

TypeScript helps you have better control over your codebase, especially when you’re working on a large codebase. TypeScript will be an extra pair of eyes for you; You better use it whenever you can.

As mentioned TypeScript is a synthetical superset of JavaScript, which means it is JavaScript, but with additional language features that don’t exist in standard JavaScript – such as static typing.

If there was no JavaScript, there wouldn’t be TypeScript. Additionally, the TypeScript code has to be eventually transpiled to JavaScript, in order to be used.

Plurasight Logo
Job-ready skills with graduation certificate → 10 days for FREE!
  • Pause or cancel anytime!
Start Today