Common TypeScript Features

Discover different TypeScript features like spread parameters, template strings, generics, optional chaining, and nullish coalescing.

TypeScript has some general features that don’t apply to classes, functions, or parameters, but make coding more efficient and fun. The idea is that the fewer lines of code we write, the better it is. It’s not only about fewer lines, but also about making things more straightforward. There are many such features in ES6 that TypeScript has also implemented. In the following sections, we’ll name a few that will likely be used in an Angular project.

Spread parameter

A spread parameter uses the same ellipsis syntax as the rest parameter but is used inside the body of a function. Let’s illustrate this with an example:

Get hands-on with 1400+ tech skills courses.