All lessons

Functions

9 min · TypeScript

Package code under a name, with typed inputs and outputs.

TypeScript · Functions0/5 cleared

Enemy 1 of 5

A function names a block of code. In TypeScript you type each parameter and the return value, like (n: number): number.

Use return to hand a value back.

You
Syntax Skeleton

Loading editor...

Ln 1, Col 1Spaces: 4
Sign up to fightTarget output: 10