TypeScript · Types and shapes

void

The return type for functions that do not return a value. A void callback may ignore any return value.

Syntax
function log(): void

Example

Example
function log(message: string): void {
  console.log(message);
}

More in this group

any Array types enums Function type Interface Literal type never null and undefined

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course