void (no return value)
A function that returns nothing.
Syntax
function name(): void { }Description
If a function does not return a value, the return type is void (performs an action but doesn't return).
Example
Loading editor…
Expected output
Hello Alex
When to use?
Functions with side effects (that just do work).