ES6 TypeScript Tutorial: Separate JavaScript Features from Type-only Syntax

ES6, also called ES2015, introduced JavaScript features such as classes, arrow functions and module syntax. TypeScript can describe code using these features and transform some syntax for different targets. Output syntax, declaration libraries and actual runtime capabilities are separate concerns, so a compiler setting should not be mistaken for an installed polyfill.

Here's a popular ES6 TypeScript video — watch it, then summarize it with one click. Or paste any other YouTube link below.

— or paste your own YouTube link —

Want to keep the key points from a YouTube video? Paste the link below to turn it into structured notes.

Why Use ES6 TypeScript Tutorial: Separate JavaScript Features from Type-only Syntax

Frequently Asked Questions

Does an ES6 feature become TypeScript-specific when annotated?

The annotation adds a static description, while the feature's behavior remains JavaScript. A class or arrow function should therefore be understood through its execution semantics as well as the checker information around it.

What does the target setting influence?

It influences supported output syntax and associated compiler behavior. It does not create every runtime API used by the program, so execution compatibility needs examination beyond the chosen output target.

Does including a library declaration install a runtime API?

Declarations tell the checker which interfaces are expected to exist. They do not provide executable implementations, so a runtime lacking an API still needs compatible support independent of those declarations.

Why is this different inside an arrow function?

An arrow function captures this from its surrounding lexical context rather than defining it through ordinary call-site binding. Types can describe usage, but they do not change that JavaScript behavior.

How should ES modules be distinguished from bundling?

Modules define import and export relationships in source and runtime conventions. A bundler processes dependencies into an execution output, performing another task whose configuration must agree with the environment.