Arrow function
arrow functionparametersstring function
(param: string) => string
Loading TypeScript...
Defining functions with the arrow syntax is especially useful when working with functions as values. Suppose in the example above, we want to make it as easy as possible for a future developer to add support for new languages.
Loading TypeScript...
Another way to describe a function is as an arrow function. There is an important caveat to arrow functions that is discussed in classes.
Arrow functions can omit parentheses if they only take a single parameter.
Arrow functions have an implicit return if the braces are omitted.