Skip to main content

4 docs tagged with "functions"

View all tags

Advanced functions

In this chapter, you learn more advanced features of functions in TypeScript.

Defining functions

Best practices for designing functions in TypeScript. Compares single responsibility / pure functions / early return / minimizing arguments / avoiding side effects / the DRY principle with Bad / Good examples. Also covers clarifying input and output with type annotations.

Function basics

In this chapter, you learn the basics of writing functions in TypeScript.

Functions

An explanation of the difference between function declarations, function expressions, and arrow functions, and how this works. Covers default parameters, the rest syntax, the lexical this of arrow functions, and how to write variadic arguments, with practical examples.