Typed arrow function
Adding types to arrow functions.
Syntax
const name = (p: type): donus => expression;
Description
Parameter/return types can also be given to short arrow functions.
Example
Loading editor…
Expected output
7
When to use?
Short, typed helper functions.